Hi,

to avoid redundancy and inconsistency i'm using some files for 
PC programs and MSP programs and the differences are encapsulated with 

#if (0 == __STDC_HOSTED__)
...
#endif

or 

#if (1 == __STDC_HOSTED__)
...
#endif

because in ANSI-C __STDC_HOSTED__ is ((int)1) if the implementation is a hosted 
implementation
and ((int)0) if it is not.

This works for *.c files but not for include files:

msp430-gcc -mmcu=msp430x168 -O2 -Wall -g -I. -I./inc1 -c -o flag.o flag.c
In file included from flag.c:4:
inc1/portablec.h:24:82: ieee754.h: File or directory not found
make: *** [flag.o] Error 1

As a workaround i'm using 

-D__STDC_HOSTED__=0

as one of the CFLAGS options and this works but gives dozens of warning lines 
in a 
medium size project:

<command line>:1:1: warning: "__STDC_HOSTED__" redefined
<command line>:1:1: warning: this is the location of the previous definition

Is there a trick to get __STDC_HOSTED__ compatible to ANSI-C or do i have
to wait till this this bug gets fixed?

Regards,

Rolf


Reply via email to