__i386__ not defined

Roger Collins roger@ProProject.com
Tue Jan 23 11:27:00 GMT 2001


Neil,

Thanks for the debugging tips.  I corrected the problem by changing a gcc
config file:

gcc/config/i386/xm-i386.h

I changed

#define __i386__

to

#define __i386__ 1

Make sense?

Can someone get this change in?

Roger

> -----Original Message-----
> From: Neil Booth [ mailto:neil@daikokuya.demon.co.uk ]
> Sent: Tuesday, January 23, 2001 1:40 PM
> To: Roger Collins
> Cc: gcc@gcc.gnu.org
> Subject: Re: __i386__ not defined
>
>
> Roger Collins wrote:-
>
> > Following the textbook native procedure on a clean download
> > (20010115), it gets a compile error because __i386__ is not defined.
>
> Not quite...
>
> > The line of code that causes the error reads
> >
> > #if __i386__
> >
> > The error message is "#if with no expression."
>
> Right.  If an identifier is not defined, it is replaced with 0 in
> preprocessor expressions, so the above line would become
>
> #if 0
>
> which is fine and legal.  Instead, what's happened is that somewhere you
> have a
>
> #define __i386__
>
> and then the preprocessor expression becomes
>
> #if
>
> which is not good.  To find out why your macro is the way it is, compile
> with
>
> gcc -E -dD
>
> or
>
> gcc -E -dM
>
> which will show which macros are defined where.
>
> Neil.
>



More information about the Gcc mailing list