C standard version (-c-version)
Specify C language standard followed in source code
Description
Specify the C language standard that you follow in your source code. This option applies to both dynamic testing and static analysis.
Set Option
Set the option using one of these methods:
- Polyspace® user interface (desktop products only): In your project configuration, select the Target & Compiler node and then select a value for this option. See Dependencies for other options you must enable first. 
- Polyspace Platform user interface (desktop products only): In your project configuration, on the Build tab, select the Target & Compiler node and then select a value for this option. See Dependencies for other options you must enable first. 
- Command line and options file: Use the option - -c-version. See Command-Line Information.
Why Use This Option
Use this option so that Polyspace can allow features specific to a C standard version during
                compilation. For instance, if you compile with GCC using the flag
                    -ansi or -std=c90, specify
                    c90 for this option. If you are not sure of the
                language standard, specify defined-by-compiler.
For instance, suppose you use the boolean data type _Bool in
                your code. This type is defined in the C99 standard but unknown in prior standards
                such as C90. If the Polyspace compilation follows the C90 standard, you can see compilation
                errors.
Some MISRA C™ rules are different based on whether you use the C90 or C99 standard. For instance, MISRA C C:2012 Rule 5.2 requires that identifiers in the same scope and name space shall be distinct. If you use the C90 standard, different identifiers that have the same first 31 characters violate this rule. If you use the C99 standard, the number of characters increase to 63.
Settings
Default:
                defined-by-compiler
- defined-by-compiler
- The analysis uses a standard based on your specification for - Compiler (-compiler).
- c90
- The analysis uses the ISO®/IEC 9899:1990 standard, informally referred to as the C90 standard. Polyspace allows the use of the C99 keyword - inlinewith the value- c90.
- c99
- The analysis uses the ISO/IEC 9899:1999 standard, informally referred to as C99 standard. 
- c11
- The analysis uses the ISO/IEC 9899:2011 standard, informally referred to as the C11 standard.. 
- c17
- The analysis uses the ISO/IEC 9899:2018 standard, informally referred to as the C17 or C18 standard. - This version addresses defects in C11 Standard but does not introduce new language features. The value of the - __STDC_VERSION__macro is increased to- 201710L.
Dependencies
- This option is available only if you set - Source code language (-lang)to- Cor- C-CPP.
- If you create a project or options file from your build system using the - polyspace-configurecommand or- polyspaceConfigurefunction, the value of this option is automatically determined from your build system.- If the build system uses different standards for different files, the subsequent Polyspace analysis can emulate your build system and use different standards for compiling those files. If you open such a project in the Polyspace user interface, the option value is shown as - defined-by-compiler. However, instead of one standard, Polyspace uses the hidden option- -options-for-sourcesto associate different standards with different files.
Command-Line Information
| Parameter: -c-version | 
| Value: defined-by-compiler|c90|c99|c11|c17 | 
| Default: defined-by-compiler | 
| Example (Bug Finder): polyspace-bug-finder -lang c -sources
                         | 
| Example (Code Prover): polyspace-code-prover -lang c -sources
                         | 
| Example (Bug Finder
                    Server): polyspace-bug-finder-server -lang c
                    -sources  | 
| Example (Code Prover
                    Server): polyspace-code-prover-server -lang c
                    -sources  |