This is the mail archive of the
gcc-help@gcc.gnu.org
mailing list for the GCC project.
Re: Preprocessor bug in MacOS ?
- From: Mihnea Balta <dark_lkml at mymail dot ro>
- To: Pat Bohrer <pbohrer at austin dot ibm dot com>, gcc-help at gcc dot gnu dot org
- Date: Mon, 20 Oct 2003 18:25:24 +0300
- Subject: Re: Preprocessor bug in MacOS ?
- References: <CD194710-0310-11D8-BEB1-000A95BA8D34@austin.ibm.com>
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/