Bug 43110

Summary: Preprocessor misinterprets multiple concatinations
Product: [Retired] Red Hat Linux Reporter: David Juran <djuran>
Component: gccAssignee: Jakub Jelinek <jakub>
Status: CLOSED NOTABUG QA Contact: David Lawrence <dkl>
Severity: medium Docs Contact:
Priority: medium    
Version: 7.1   
Target Milestone: ---   
Target Release: ---   
Hardware: i386   
OS: Linux   
URL: http://xmps.sourceforge.net/sources/xmps-0.2.0.tar.gz
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2001-05-31 20:09:38 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description David Juran 2001-05-31 20:09:34 UTC
From Bugzilla Helper:
User-Agent: Mozilla/4.77 [en] (X11; U; Linux 2.4.2-2smp i686)

Description of problem:
When the preprocessor encounters 
The preprocessor throws an error at me when it encounters double
concatinations

How reproducible:
Always

Steps to Reproduce:
The following code, run through the preprocessor (gcc -E) gives an error.
With egcs (egcs -E) it works

#define MC_FUNC(op,xy)				\
static void motion_comp_##op####xy##_16x16_c

MC_FUNC(put,);

	

Actual Results:  the preprocessor bundeled with gcc 2.96 gives me 
 warning: pasting "motion_comp_put" and "##" does not give a valid
preprocessing token

Expected Results:  I was hoping to get 

static void motion_comp_put_16x16_c ;

as output from the preprocessor

Additional info:

Comment 1 Jakub Jelinek 2001-05-31 20:28:56 UTC
The C standard sais if pasting two tokens with ## does not create
a valid preprocessor token, then the behaviour is undefined.
gcc has a warning about this, so that you can fix the code,
if you use just a single ## it will work just fine.
The fact that it used to work with older gcc cannot be an excuse
or broken code.