This is the mail archive of the gcc@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]

Re: Strange gcc-3.0.1 preprocessor


Hello, Neil!
On Sun, 14 Oct 2001 18:59:34 +0100, you wrote:

> Nick Kurshev wrote:-
> 
> > It was only way to build such trick. Else how you will notice
> > compiler to build preprocessor string without space characters?
> 
> Like I told you.
> 
> > Well, the same code with space characters around __MACHINE__:
> > source:
> >     #define _INLINES <biewlib/sysdep/ __MACHINE__ /_inlines.h>
> >     #define __CONFIG <biewlib/sysdep/ __MACHINE__ /__config.h>
> >     #include __CONFIG
> >     #include _INLINES
> 
> Why have you added spaces?  Of course it will now break:
> 
> > output:
> > biewlib/sysdep/_sys_dep.h:30:22: biewlib/sysdep/ ia32 /__config.h: No such file or directory
> > biewlib/sysdep/_sys_dep.h:31:22: biewlib/sysdep/ ia32 /_inlines.h: No such file or directory
> 
> The following works for me:
> 
> #define STDIO stdio
> #define STDIO_H </usr/include/STDIO.h>
> #include STDIO_H
> 
> Note that the preprocessor does not do string literal concatenation in
> header names.
> 
> Neil.
> 
But for me - no.

#undef __MACHINE__
#define __MACHINE__ ia32
    #define _INLINES <biewlib/sysdep/__MACHINE__/_inlines.h>
    #define __CONFIG <biewlib/sysdep/__MACHINE__/__config.h>
    #include __CONFIG
    #include _INLINES

In file included from biewlib/biewlib.c:24:
biewlib/sysdep/__config.h:27:14: warning: pasting "/" and "__MACHINE__" does not give a valid preprocessing token
biewlib/sysdep/__config.h:27:22: biewlib/sysdep/__MACHINE__/__config.h: No such file or directory
make: *** [biewlib/biewlib.o]  1

Best regards! Nick


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