__STDC_HOSTED__ is wrong!

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

__STDC_HOSTED__ is wrong!

Rolf Freitag

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



-------------------------------------------------------
SF.Net email is sponsored by: Discover Easy Linux Migration Strategies
from IBM. Find simple to follow Roadmaps, straightforward articles,
informative Webcasts and more! Get everything you need to get up to
speed, fast. http://ads.osdn.com/?ad_id=7477&alloc_id=16492&op=click
_______________________________________________
Mspgcc-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/mspgcc-users