I don't really understand how the _XXXX_SOURCE macros
are supposed to work.  It would seem logical to expect
_ISOC99_SOURCE to work the same as _POSIX_SOURCE etc,
only with respect to a different standard.

In general, if you want to control the C99 nature
of a C program when using Sun Studio on Solaris, you
should use the -xc99 option.

The C manual is here:
http://docs.sun.com/app/docs/doc/819-3688

The appendix for options is here:
http://docs.sun.com/source/819-3688/cc_ops.app.html

Maybe Don can shed more light on the general
behavior of the various _XXXX_SOURCE macros.

--chris



Roland Mainz wrote:
> Glenn Fowler wrote:
>> on solaris (and/or in general) can a user call vanilla cc with
>>         cc -D_ISOC99_SOURCE
>> and expect it to work, or can such usage require some implementation
>> semantic knowledge, like extra -D or -l options
> 
> I don't know... I've been trying find any documentation in Solaris but
> it seems the only places where |_ISOC99_SOURCE| is used in Solaris is...
> -- snip --
> $ ggrep -r _ISOC99_SOURCE /usr/man
> $ ggrep -r _ISOC99_SOURCE /usr/include 2>/dev/null
> /usr/include/gstreamer-0.10/gst/floatcast/floatcast.h:        #define
> _ISOC99_SOURCE  1
> $ ggrep -r _ISOC99_SOURCE /opt/SUNWspro/ 2>/dev/null
> $ ggrep -r _ISOC99_SOURCE /usr/sfw/ 2>/dev/null
> -- snip --
> ... which leads to the question what |_ISOC99_SOURCE| should do...
> 
>> in a similar vein, can there be a difference between
>>         cc -D_ISOC99_SOURCE
>> and
>>         #define _ISOC99_SOURCE 1
>> before and #include's
>> e.g., can a cc inplementation overload -D_ISOC99_SOURCE to enable
>> other appropriate options and libs?
>>
>> practical (system x does it) and standard-ese responses welcome
> 
> Don/Chris... can you help, please ?
> 
> ----
> 
> Bye,
> Roland
> 

Reply via email to