Standard Language Conformance Options
Descriptions of the options for standard language conformance.
-h [no]conform, -h [no]stdc
Default: -h noconform
Default: -h nostdc
-h conform specifies strict conformance to the ISO C standard or the ISO C++ standard. The -h [no]stdc option specifies strict conformance to the ISO C standard and does not relate to C++. The -h noconform and -h nostdc options specify partial conformance to the standard.
The -h conform option enables -h exceptions, -h dep_name, -h parse_templates, and -h const_string_literals options in Cray C++.
By default, the compiler calls the Cray mathlib versions of intrinsic functions (abs, cos, exp, for example) which do not set errno and do not raise IEEE-754 underflow exceptions. If -hconform is specified, the compiler calls the stdc glibc versions of the runtime intrinsic functions.
When -h noc99 is used, C99 language features such as variable-length arrays (VLAs) and restricted pointers that were available as extensions previously to adoption of the C99 standard remain available.
-h [no]gnu
Default: -h gnu
Enables the compiler to recognize the GCC extensions to C listed in GCC C Language Extensions. For detailed descriptions of the GCC C and C++ language extensions, see the tables below and http://gcc.gnu.org/onlinedocs/.
| GCC C Language Extension | Description |
|---|---|
| Typeof | typeof: referring to the type of an expression |
| Lvalues | Using ?:, and casts in lvalues |
| Conditionals | Omitting the middle operand of a ?: expression |
| Long Long | Double-word integers – long long int |
| Complex | Data types for complex numbers |
| Statement Exprs | Putting statements and declarations inside expressions |
| Zero Length | Zero-length arrays |
| Variable Length | Arrays whose length is computed at run time |
| Empty Structures | Structures with no members; applies to C but not C++ |
| Variadic Macros | Macros with a variable number of arguments |
| Escaped Newlines | Slightly looser rules for escaped newlines |
| Multiline strings | String literals with embedded newlines |
| Initializers | Non-constant initializers |
| Compound Literals | Compound literals give structures, unions or arrays as values |
| Designated Inits | Labeling elements of initializers |
| Cast to Union | Casting to union type from any member of the union |
| Case Ranges | 'case 1 ... 9' and such |
| Mixed Declarations | Mixing declarations and code |
| Attribute Syntax | Formal syntax for attributes |
| Function Prototypes | Prototype declarations and old-style definitions; applies to C but not C++ |
| C++ Comments | C++ comments are recognized |
| Dollar Signs | Dollar sign is allowed in identifiers |
| Character Escapes | \e stands for the character <ESC> |
| Alignment | Inquiring about the alignment of a type or variable |
| Inline | Defining inline functions (as fast as macros) |
| Alternate Keywords | __const__, __asm__, and so on, for header files |
| Incomplete Enums | enum foo;, with details to follow |
| Function Names | Printable strings which are the name of the current function |
| Return Address | Getting the return or frame address of a function |
| Unnamed Fields | Unnamed struct/union fields within structs/unions |
| Function Attributes: nothrow; format, format_arg; deprecated; used; unused; alias; weak | Declaring that functions have no side effects, or that they can never return |
| Variable Attributes: alias; aligned; deprecated; unused; used; transparent_union; weak | Specifying attributes of variables |
| Type Attributes: deprecated; unused; used; transparent_union | Specifying attributes of types |
| Asm Labels | Specifying the assembler name to use for a C symbol |
| Other Builtins: __builtin_types_compatible_p, __builtin_choose_expr, __builtin_constant_p, __builtin_huge_val, __builtin_huge_valf, __builtin_huge_vall, __builtin_inf, __builtin_inff, __builtin_infl, __builtin_nan, __builtin_nanf, __builtin_nanl, __builtin_nans, __builtin_nansf, __builtin_nansl | Other built-in functions |
| GCC C++ Extensions | Description |
|---|---|
| Min and Max | C++ minimum and maximum operators |
| Restricted Pointers | C99 restricted pointers and references |
| Backwards Compatibility | Compatibilities with earlier definitions of C++ |
| Strong Using | A using directive with __attribute ((strong)) |
| Explicit template specializations | Attributes may be used on explicit template specializations |
-h std=language_standard
Determines the C/C++ language standard. language_standard can be either c99, c89, c++03, c++11, or c11. The default, if this option is not specified, is c99/ c++03. This option does not imply strict conformance to the language standard. That is controlled by the -h conform and -h stdc options.
If both -h std=c++11 and -h conform are specified on a command line, -h conform is disabled, as specifying c++11 implies -h gnu by default.