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/.

Table 1. GCC C Language Extensions
GCC C Language ExtensionDescription
Typeoftypeof: referring to the type of an expression
LvaluesUsing ?:, and casts in lvalues
ConditionalsOmitting the middle operand of a ?: expression
Long LongDouble-word integers – long long int
ComplexData types for complex numbers
Statement ExprsPutting statements and declarations inside expressions
Zero LengthZero-length arrays
Variable LengthArrays whose length is computed at run time
Empty StructuresStructures with no members; applies to C but not C++
Variadic MacrosMacros with a variable number of arguments
Escaped NewlinesSlightly looser rules for escaped newlines
Multiline stringsString literals with embedded newlines
InitializersNon-constant initializers
Compound LiteralsCompound literals give structures, unions or arrays as values
Designated InitsLabeling elements of initializers
Cast to UnionCasting to union type from any member of the union
Case Ranges'case 1 ... 9' and such
Mixed DeclarationsMixing declarations and code
Attribute SyntaxFormal syntax for attributes
Function PrototypesPrototype declarations and old-style definitions; applies to C but not C++
C++ CommentsC++ comments are recognized
Dollar SignsDollar sign is allowed in identifiers
Character Escapes\e stands for the character <ESC>
AlignmentInquiring about the alignment of a type or variable
InlineDefining inline functions (as fast as macros)
Alternate Keywords__const__, __asm__, and so on, for header files
Incomplete Enumsenum foo;, with details to follow
Function NamesPrintable strings which are the name of the current function
Return AddressGetting the return or frame address of a function
Unnamed FieldsUnnamed struct/union fields within structs/unions
Function Attributes: nothrow; format, format_arg; deprecated; used; unused; alias; weakDeclaring that functions have no side effects, or that they can never return
Variable Attributes: alias; aligned; deprecated; unused; used; transparent_union; weakSpecifying attributes of variables
Type Attributes: deprecated; unused; used; transparent_unionSpecifying attributes of types
Asm LabelsSpecifying 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_nanslOther built-in functions
Table 2. GCC C++ Language Extensions
GCC C++ ExtensionsDescription
Min and MaxC++ minimum and maximum operators
Restricted PointersC99 restricted pointers and references
Backwards CompatibilityCompatibilities with earlier definitions of C++
Strong UsingA using directive with __attribute ((strong))
Explicit template specializationsAttributes 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.