JavaScript is not currently enabled, but is required for full CodeSonar manual search and browse functionality.
If you are viewing this file in your hub's Web GUI, enable JavaScript in your browser: you will also need it for GUI functionality.
If you opened this file directly from disk, your browser may be directly suppressing JavaScript functionality: certain browsers perform this suppression on local files (but not files delivered by web servers) for security reasons.
| CodeSonar® 28.0w | AdaCore Inc |
A local declaration uses auto as a deduced type specifier in a mode that treats it as a nonstandard extension. The construct is still accepted but is not part of the standard for the selected dialect.
| Class Name | auto Type Nonstandard |
|---|---|
| Significance | style |
| Mnemonic | PARSE.ATN |
| Categories | None |
| Availability | Available for C and C++. |
| Enabling | Checks for this warning class are
disabled by default. To enable them, add the following WARNING_FILTER
rule to the project configuration file.
WARNING_FILTER += allow class="auto Type Nonstandard" |
int f() {
auto x = 42; // 'auto Type Nonstandard' warning issued here
return x;
}
int read_value_fixed()
{
int value = 42; // ok: explicitly name the type in C++03
return value;
}
To reproduce this example, analyze it with the following configuration:
WARNING_FILTER += allow class="auto Type Nonstandard" # Use clang C++ mode so that the parser recognizes auto as a potential # type specifier even outside the C++11 standard, and disable the implicit # enabling of auto-as-type so that the use of auto here is treated as a # nonstandard extension. EDG_FRONTEND_OPTIONS_PREPEND += --clang --no_auto_type
g++ -c -std=c++03 example.cpp
The following configuration file parameters affect checks for this warning class.
To report problems with this documentation, please visit https://support.adacore.com/csm.