This is the mail archive of the gcc-help@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Preprocessor bug in MacOS ?


  My guess is that the stuff you're concatenating must be single tokens (I 
think the manual documents this somewehere, look to where ## is described). 
0_1, 1_2, etc. are not vald tokens, so it does wierd stuff.

On Monday 20 October 2003 18:19, Pat Bohrer wrote:
> I was trying to build 64-bit PowerPC Linux cross compiler on MacOS-X
> and ran into the following build problem.
> I narrowed it down to a preprocessor problem.
>
> If I take the following code:
> bash-2.05a$ cat try.c
> #define CONCAT4(a,b,c,d)    (a##b##c##d)
>
> main()
> {
>      CONCAT4(A,B,C,D)
>      CONCAT4(A_A,B_B,C_C,D_D)
>      CONCAT4(0_1,1_2,3_4,5_6)
>
> }
>
> and run it through the preprocessor on MacOS-X I get:
>
> bash-2.05a$ cc -E try.c
> try.c:7: illegal function call, found `_11'
> try.c:7: illegal statement, missing `;' after `)'
> cpp-precomp: warning: errors during smart preprocessing, retrying in
> basic mode
> # 1 "try.c"
>
>
> main ( )
> {
> ( ABCD )
> ( A_AB_BC_CD_D )
> ( 0 _11 _23 _45 _6 )
>
> }
>
> Any ideas why spaces are being inserted between the first number
> separated by an '_' ?
>
> --Pat
>
>
>
> ---------------------------------------------------------------
> Acasa.ro vine cu albumele, tu vino doar cu pozele ;)
> http://poze.acasa.ro/


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]