disabled c99 in Solaris builds

Erik Joelsson erik.joelsson at oracle.com
Tue Dec 11 17:27:28 UTC 2018


Hello,

I do not know why this flag was introduced, but it has been there for a 
long time. In JDK7 it's listed in jdk/make/common/Defs-solaris.gmk:

#       -xc99=%none     Do NOT allow for c99 extensions to be used.
#                       e.g. declarations must precede statements

and was there since the first mercurial change.

I personally wouldn't mind ditching it.

/Erik

On 2018-12-11 08:17, Baesken, Matthias wrote:
> 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
>
>
> - with C99 disabled as OpenJDK does :
> ----------------------------------------------------------
>
> /compiler/SS12u4-Oct2017/SUNWspro/bin/cc -xc99=%none   vardecl.c -o vardecl
> "vardecl.c", line 8: warning: declaration can not follow a statement
>
>
> - with C99 disabled + errwarn as OpenJDK does :
> ------------------------------------------------------------------------
>
> /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