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

Exit Print View

Updated: July 2016
 
 

Changes to Compilers

The following section describes changes made to the compilers and includes the following topics:

New and Changed Features Common to the Compilers

The following changes were made to the C, C++, and Fortran compilers since the previous release. Details can be found in the compiler man pages. The changes specific to the C++ compiler are detailed in C++ Compiler. The changes specific to the C compiler are detailed in C Compiler.

Application Performance on New Hardware

Every Oracle Developer Studio release includes performance improvements for Oracle Sun hardware servers. This release includes expanded support for the SPARC M6, SPARC M7, SPARC T7, SPARC S7 and Intel Broadwell/avx2_i processors.

Other Compiler Changes

The following list describes other changes that affect the C, C++, and Fortran compilers:

  • Support for SPARC M6, M7, T7 and S7 processors.

  • Support for x86 dataspace profiling.

  • –xcheck has a new default –xcheck=stkovfl.

  • New Compiler Options:

    • –features=[no]mergestrings causes the compiler to put string literals and other suitable const or read-only data into a special section of the binary where the linker removes duplicate strings.This option is available only on SPARC.

    • –xsecure_code_analysis enables compiler secure code analysis to find and display possible memory safety violations at compile time.

    • –xtarget=S7, –xchip=S7 are supported in the compiler driver.

Fortran Compiler

The Fortran compiler supports technical and scientific application development with record-setting runtime performance and compatibility options for the Fortran77, Fortran90, and Fortran95 standards. The majority of Fortran 2003 features and OpenMP 4.0 support is included. The Fortran compiler uses the same high-performance code generation technology as the C and C++ compilers, ensuring that the resulting application generates the highest-performance parallel code for the newest SPARC and x86-based Oracle systems.

The Fortran compiler changes include the changes that are described in New and Changed Features Common to the Compilers and the following changes:

  • The maximum length of a free-source form line has been increased from 132 to 250 characters.

For more information, see the f95(1)man page and the Oracle Developer Studio 12.5: Fortran User’s Guide.

New Static Analysis Features

Compile time warnings for memory safety checks are generated by default for the C and C++ compilers.

The following message tags are included:

  • SEC_UNINITIALIZED_MEM_READ

  • SEC_UNINITIALIZED_BITOP

  • SEC_UNDEFINED_RETURN_VALUE

  • SEC_ARR_OUTSIDE_BOUND_READ

  • SEC_ARR_OUTSIDE_BOUND_WRITE

  • SEC_FREED_PTR_RETURN

  • SEC_READ_FREED_PTR

  • SEC_WRITE_FREED_PTR

  • SEC_NULL_PTR_DEREF

The warnings are emitted to stderr along with all other compile time errors and warnings. They are controlled by the –erroff, –errtags, and –errwarn command line options and the error_messages() pragma, similar to all other compile time messages.

How to use –errwarn Command Line Option

The –errwarn command line option can be used to turn the memory safety check warnings into fatal errors. For example:

  • –errwarn=SEC_NULL_PTR_DEREF makes any null pointer dereferences fatal errors.

  • –errwarn=%all makes all compile time warnings fatal errors.

How to Disable Static Error Checking

The static error checking is run in parallel with the compiler back end processing. In certain situations, such as heavily loaded systems or extremely large modules containing extremely complex flow control, compile time can be increased. For scenarios where compile time is absolutely critical, static error checking can be disabled at the expense of suppressing possibly serious diagnostic messages via the command line option –xsecure_code_analysis=no.

Alternatively, you can use Oracle Developer Studio's default config file feature to disable static error checking for an entire site. For example, you can use the config files cc.defaults or CC.defaults. You can also use c89.defaults or c99.defaults. The install path is install-dir/lib/compilers/etc/config..

You can use the SPRO_DEFAULTS_PATH environment variable to disable default static error checking without the need for makefile changes: SPRO_DEFAULTS_PATH=path, where path is the directory containing the defaults file.

Using the error_messages() Pragma to Enable and Disable SEC Messages

The error_messages() pragma can be used to selectively enable and disable SEC messages according to specified regions of your source files.

The following example shows how to disable specific SEC warning on a specific statement:

cat foo.c:
     <some code>
#pragma error_messages (off, tag-of-interest)
   <statement of interest>
#pragam error_messages (default|on, tag-of-interest)
   <remainder of code>

where tag-of-interest is one of the SEC front end warnings.

To disable all SEC warnings in a region of code:

    cat foo.c:
     <some code>
#pragma error_messages (off, SEC_UNINITIALIZED_MEM_READ,SEC_UNINITIALIZED_BITOP,SEC_UNDEFINED_RETURN_VALUE,SEC_ARR_OUTSIDE_BOUND_READ,
SEC_ARR_OUTSIDE_BOUND_WRITE,SEC_DOUBLE_FREE,SEC_FREED_PTR_RETURN,SEC_READ_FREED_PTR,SEC_WRITE_FREED_PTR,SEC_NULL_PTR_DEREF
)
   line-or-lines-of-interest
#pragam error_messages (default|on, SEC_UNINITIALIZED_MEM_READ,SEC_UNINITIALIZED_BITOP,SEC_UNDEFINED_RETURN_VALUE,
SEC_ARR_OUTSIDE_BOUND_READ,SEC_ARR_OUTSIDE_BOUND_WRITE,SEC_DOUBLE_FREE,SEC_FREED_PTR_RETURN,SEC_READ_FREED_PTR,SEC_WRITE_FREED_PTR,
SEC_NULL_PTR_DEREF
)
   <remainder of code>