| United States-English |
|
|
|
![]() |
HP Itanium-based Systems: HP aC++/HP C Programmer's Guide > Chapter 2 Command-Line OptionsStandards Related Options |
|
The compiler accepts the following options related to the ANSI/ISO 9899-1990 Standard for the C Programming Language, the ANSI/ISO International Standard, and ISO/IEC 14882 Standard for the C++ Programming Language: -Aa The -Aa option instructs the compiler to use Koenig lookup and strict ANSI for scope rules. This option is equivalent to specifying -Wc,-koenig_lookup,on and -Wc,-ansi_for_scope,on. The default is off. Refer to -Ae option for aC++ C-mode description. The standard features enabled by -Aa are incompatible with earlier C and C++ features. -AA The -AA option enables the use of the new 2.0 Standard C++ Library, which includes the new standard conforming (templatized) iostream library. This is the first release of the 2.0 library. It conforms to the ISO C++ standard. The default is -AA without -Wc,-ansi_for_scope. The 2.0 library, a new addition to the HP C++ runtime, is not compatible with the version 1.2.1 Standard C++ Library previously bundled with HP aC++. HP aC++ will continue support for standard C++ library 1.2.1 without name or location change. Customers should not notice any change when -AA is not used. However, the 1.2.1 library is deprecated and will be replaced by the new library eventually. To use the new 2.0 library, you must consistently use the -AA option to compile and link all translation units. Mixing object files within an executable is not supported. The version of the 2.0 Standard C++ library (libstd_v2) included in this release is incompatible with the previous versions of the same library. Using the -AA option and the new 2.0 library creates a binary incompatibility with any other applications/libraries compiled with the -AA option under the previous version of the aC++ product. To use the new 2.0 library, you must recompile using the -AA option. Usage: The standard features enabled by -AA are incompatible with the older Rogue Wave Standard C++ Library 1.2.1 and Tools.h++ 7.0.6. All modules must be consistent in using -AA. Mixing modules compiled with -AA with ones that are not is not supported. The -Wc,-koenig_lookup,on and -Wc,-ansi_for_scope,on options are also set.
-Aarm This option enables the Tru64 UNIX C++ Annotated Reference Manual (ARM) dialect. This dialect was the default for Tru64 UNIX C++ compilers through compiler version 5.x. Support of this dialect is intended only to ease porting of existing Tru64 UNIX applications to HP-UX, and not for development of new programs. For more information on the ARM dialect, refer to the The Annotated C++ Reference Manual, (Margaret A. Ellis and Bjarne Stroustrup, Addison-Wesley, ISBN 0-201-51459-1, 1990). -AC89 The -AC89 option invokes the compiler in ANSI C89 compilation mode. This option, when specified with -ext option, invokes a part of ANSI C99 features. -Ae Setting the -Ae option invokes aC++ as an ANSI C compiler, with additional support for HP C language extensions. This option is a synonym for -AC89 -ext option. For C++, if -Ae is anywhere on the command line, C-mode will be in effect. The options, -AA and -AP, are ignored with warnings. If both -Ae and -Aa are present, C-mode will be in effect and the right most option determines whether extended ANSI (-Ae) or strict ANSI (-Aa) is in effect. To get strict ANSI, both -Ae and -Aa option are required.
This option enables GNU C++ dialect compatibility. Not all GNU features are available, for instance, the asm mechanism. See also “-fshort-enums ”. This option enables GNU C dialect compatibility. Not all GNU features are available, for instance, the asm mechanism. See also “-fshort-enums ”.
-AOa -AOe See the following C mode options: In addition to specifying the ANSI C language dialect, allows the optimizer to aggressively exploit the assumption that the source code conforms to the ANSI programming language C standard ISO 9899:1990. At present, the effect is to make +Otype_safety=ansi the default. As new independently-controllable optimizations are developed that depend on the ANSI C standard, the flags that enable those optimizations may also become the default under -AOa or -AOe. -AP The -AP option turns off -AA mode and uses the older C++ runtime libraries.
+legacy_cpp The +legacy_cpp option enables the use of cpp.ansi ANSI C preprocessor. This option is available in aC++ C-mode only.
+legacy_v5 This option enables the use of the A.05.60 compiler. The default compiler is the A.06.00 compiler. +tru64 This option causes return types of unprototyped functions to be treated as long, instead of int, matching Tru64 C behavior. This can prevent segfaults in +DD64 mode, resulting from pointer truncation, for instance:
A preferable solution is to provide the appropriate function prototypes.
The -Wc,-ansi_for_scope is option enables or disables the standard scoping rules for init declarations in for statements; the scope of the declaration then ends with the scope of the loop body. By default, the option is disabled. Examples: In the following example, if the option is not enabled (the current default), the scope of k extends to the end of the body of main() and statement (1) is valid (and will return zero). With the option enabled, k is no longer in scope and (1) is an error.
In the next example, with the option disabled, the code is illegal, because it redefines k in (2) when a previous definition (1) is considered to have occurred in the same scope. With the option enabled (-Wc,-ansi_for_scope,on), the definition in (1) is no longer in scope at (2) and thus the definition in (2) is legal.
The -WC,-koenig_lookup option enables or disables standard argument-dependent lookup rules (also known as Koenig lookup). It causes functions to be looked up in the namespaces and classes associated with the types of the function-call argument. By default, the option is enabled. Example: In the following example, if the option is not enabled, the call in main() does not consider declaration (1) and selects (2). With the option enabled, both declarations are seen, and in this case overload resolution will select (1).
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|||||||||||||||