disabled c99 in Solaris builds (original) (raw)

Baesken, Matthias matthias.baesken at sap.com
Tue Dec 11 16:17:28 UTC 2018


Hello , it seems that currently the Solaris Oracle Studio Build environment is the only one that explicitly forbids C99 C code by setting -xc99=%none . The current Linux/Mac/AIX/Windows build envs had no issues with the coding.

For example I was running into an error with the C variable declaration order issue (small example below) today in my coding. Is this still a wanted behavior ? What was the reason behind setting -xc99=%none , and is the reason still valid ? I remember we had issues with C99 compatibility back then when VS2010 was used on Windows, but I think these days we use VS2013+, is this correct ?

The example program mixes declarations and "other statements" , which needs C99, I compile with Oracle Studio 12u4 .

/compiler/SS12u4-Oct2017/SUNWspro/bin/cc vardecl.c -o vardecl

No settings -> works nicely


/compiler/SS12u4-Oct2017/SUNWspro/bin/cc -xc99=%none vardecl.c -o vardecl "vardecl.c", line 8: warning: declaration can not follow a statement


/compiler/SS12u4-Oct2017/SUNWspro/bin/cc -xc99=%none -errwarn=%all vardecl.c -o vardecl "vardecl.c", line 8: declaration can not follow a statement cc: acomp failed for vardecl.c

example program :

bash-3.2$ more vardecl.c #include <stdio.h>

int main(void) { int a = 0; printf("a: %d \n", a);

int b = 1; printf("b: %d \n", b); return 0; }

Best regards, Matthias



More information about the build-dev mailing list