Go to main content
What's New in the Oracle® Developer Studio 12.5 Release

Exit Print View

Updated: July 2016
 
 

Moving From the –xc99 Flag to –std Flags

With the introduction of support for C11, the language dialect is no longer a simple binary choice between C89 & C99, there is now a third choice: C11.

With Oracle Solaris Studio 12.3 the choice was C99 vs C89 and was controlled by the –xc99 flag:

Flag
Language Dialect
–xc99=all
C99 language
–xc99=none
C89 language

With Oracle Solaris Studio 12.4 and Oracle Developer Studio 12.5 the choice of language dialect (C89, C99, or C11) should be controlled using the –std flag:

Flag
Language Dialect
–std=c11
C11 language
–std=c99
C99 language
–std=c89
C89/C90 language

The following is a simple mapping between –xc99 flag and the –std flag:

–xc99 Flag
–std Flag
–xc99
–std=c99
–xc99=all
–std=c99
–xc99=all,lib
–std=c99
–xc99=all,no_lib
–std=c99 –xlang=c89
–xc99=none,lib
–std=c89 –xlang=c99
–xc99=none,no_lib
–std=c89
–xc99none
–std=c89

The following options for controlling language dialec are or will soon be deprecated in the Oracle Developer Studio C Compiler: –Xc, –Xa, –Xt, –xc99.

  • –xc99: Choose between ISO C99 or C89 language

  • –Xc: Issue errors and warnings for programs that use non-ISO C constructs

  • –Xa: Accept ISO C plus extensions to the C language

  • –Xt: Accept ISO C plus K&R C compatibility extensions

  • –Xs: Accept K&R C

Instead, the –std option should be used, along with the –pedantic option if you were using –Xa. Legacy code using –Xt or –Xs will need conversion to an ISO C dialect.

The –xlang option can be used to control the behavior of specific libc functions that relate to standard conformance. In the Oracle Solaris Studio 12.4 C compiler, the default behavior was C11 language constructs and C89 library behavior. In this default mode, ___STDC_VERSION__ (199409L) indicates the C89 standard.

In the Oracle Developer Studio 12.5 C Compiler, both the language features and library behavior defaults to C11 mode, and __STDC_VERSION__ (201112L) reflects C11.

Note: In Oracle Solaris Studio 12.3, this behavior was controlled by the suboption –xc99=lib.