Bug 43110 - Preprocessor misinterprets multiple concatinations
Summary: Preprocessor misinterprets multiple concatinations
Alias: None
Product: Red Hat Linux
Classification: Retired
Component: gcc   
(Show other bugs)
Version: 7.1
Hardware: i386 Linux
Target Milestone: ---
Assignee: Jakub Jelinek
QA Contact: David Lawrence
URL: http://xmps.sourceforge.net/sources/x...
Depends On:
TreeView+ depends on / blocked
Reported: 2001-05-31 20:09 UTC by David Juran
Modified: 2007-04-18 16:33 UTC (History)
0 users

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

Attachments (Terms of Use)

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

How reproducible:

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



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.

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