__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


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__)


#if (1 == __STDC_HOSTED__)

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


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?



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]