Bug 43110 - Preprocessor misinterprets multiple concatinations
Preprocessor misinterprets multiple concatinations
Status: CLOSED NOTABUG
Product: Red Hat Linux
Classification: Retired
Component: gcc (Show other bugs)
7.1
i386 Linux
medium Severity medium
: ---
: ---
Assigned To: Jakub Jelinek
David Lawrence
http://xmps.sourceforge.net/sources/x...
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2001-05-31 16:09 EDT by David Juran
Modified: 2007-04-18 12:33 EDT (History)
0 users

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2001-05-31 16:09:38 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description David Juran 2001-05-31 16:09:34 EDT
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 16:28:56 EDT
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.

Note You need to log in before you can comment on or make changes to this bug.