-Xansi


This option processes as making C source program comply strictly with the ANSI standard.

[Specification format]

-Xansi

 

-

Interpretation when omitted

Compatibility with the conventional C language specifications is conferred and processing continues after warning is output.

[Detailed description]

-

This option processes as making C source program comply strictly with the ANSI standardNote and outputs an error or warning for a specification that violates the standard.

-

When this option is specified, macro name "__STDC__" is defined as the macro that the value is 1.

-

Processing when compiling in strict adherence to the language specification is as follows.

-

Bit fields

An error will occur if a type other than an int type is specified in a bit field.

If this option is not specified, specifying a type other than an int type will be enabled (A warning will not be output).

-

#line-number

An error will occur.

If this option is not specified, "#line-number" will be handled in the same way as "#line line-number".

-

Argument of function for which #pragma inline is specified

If the type of the return value or parameter is different but type conversion is possible between the specified function call and definition, an error will occur.

If this option is not specified, the type of the return value is converted to the type at the call side, the parameters are converted to the type of the function definition, and inline expansion is performed.

Note

This is a standard specified by ISO/IE C9899:1990 (C90).
Although ccrh also accepts some of the specifications added by ISO/IE C9899:1999 (C99), if this option is specified, code in violation of the standard will cause an error.

[Example of use]

-

To process as making C source program comply strictly with the ANSI standard and output an error or warning for a specification that violates the standard, describe as:

>ccrh -Xansi -Xcommon=rh850 main.c