-xlang=c99 support under Linux?
Trying to keep some code portable between Solaris and Linux, I decided to try the
December build of Studio Express on Linux. Now I'm getting a strange error, here
stripped down to bare essentials:
% uname -a
Linux ferrari 2.6.9-42.EL #1 Wed Jul 12 23:15:20 EDT 2006 x86_64 x86_64 x86_64 GNU/Linux
% /pub/opt/sun/sunstudiomars/bin/CC -xlang=c99 -c foo.cc
CC: -xlang=c99 is unavailable on Solaris 6
There are two questions here.
(1) -xlang=c99 worked with previous Studio Express releases on SPARC.
What is the equivalent option now with the new release, under Linux?
(2) What is Solaris 6, and why is it being mentioned when I'm running under Linux?
[717 byte] By [
hertega] at [2007-11-26 13:50:43]

# 2
I checked out the situation, and filed bug 6508850 for you.
Solaris 10 has two versions of the C runtime library libc (which is also the Solaris runtime library). By default, you get the C90 version. The C99 standard introduced some minor behavior differences that could affect some programs. The C compiler options -xc99=all or -xc99=lib select the C99 library. The C++ compiler option -xlang=c99 selects the C99 library.
Linux has only one C library. Varying degrees of C99 support are available, depending on the Linux distribution and the gcc version.
For C++ on Linux, you can simply omit the -xlang=c99 option, since it should have no effect.