Oracle® Solaris Studio 12.4: C++ User's Guide

Exit Print View

Updated: March 2015
 
 

2.4.5 Compiler Command-Line Diagnostics

The -V option displays the name and version number of each program invoked by CC. The -v option displays the full command lines invoked by CC.

The —verbose=%all displays additional information about the compiler.

Any arguments on the command line that the compiler does not recognize are interpreted as linker options, object program file names, or library names.

The basic distinctions are:

  • Unrecognized options, which are preceded by a dash () or a plus sign (+), generate warnings.

  • Unrecognized nonoptions, which are not preceded by a dash or a plus sign, generate no warnings. However, they are passed to the linker. If the linker does not recognize them, they generate linker error messages.

In the following example, note that -bit is not recognized by CC and the option is passed on to the linker (ld), which tries to interpret it. Because single letter ld options can be strung together, the linker sees -bit as -b -i -t, all of which are legitimate ld options. This result might not be what you intend or expect:

example% CC -bit move.cc      -bit is not a recognized compiler option
CC: Warning: Option -bit passed to ld, if ld is invoked, ignored otherwise

In the next example, the user intended to type the CC option -fast but omitted the leading dash. The compiler again passes the argument to the linker, which in turn interprets it as a file name:

example% CC fast move.cc           < -  The user meant to type -fast
move.CC:
ld: fatal: file fast: cannot open file; errno=2
ld: fatal: File processing errors. No output written to a.out