AutosarC++17_03-A18.0.3¶
The library <clocale> (locale.h) and the setlocale function shall not be used
Required inputs: IR
| Level | required |
|---|---|
| Target | implementation |
| Enforcement | automated |
Rationale
A call to the setlocale function introduces a data race with other calls to setlocale function.
It may also introduce a data race with calls to functions that are affected by the current locale settings: fprintf, isprint, iswdigit, localeconv, tolower, fscanf, ispunct, iswgraph, mblen, toupper, isalnum, isspace, iswlower, mbstowcs, towlower, isalpha, isupper, iswprint, mbtowc, towupper, isblank, iswalnum, iswpunct, setlocale, wcscoll, iscntrl, iswalpha, iswspace, strcoll, wcstod, isdigit, iswblank, iswupper, strerror, wcstombs, isgraph, iswcntrl, iswxdigit, strtod, wcsxfrm, islower, iswctype, isxdigit, strxfrm, wctomb.
See Also
- JSF December 2005 [7]: AV Rule 19 <locale.h> and the setlocale function shall not be used.
Possible Messages
Key |
Text |
Severity |
Disabled |
|---|---|---|---|
forbidden_libheader_symbol_use |
Usage of forbidden entity from <{}>. |
None |
False |
Options¶
This rule shares the following common options: confidence, exclude_in_macros, exclude_messages_in_system_headers, excludes, extend_exclude_to_macro_invocations, includes, justification_checker, languages, post_processing, provider, report_at, severity
The following places define options that affect this rule: Stylechecks, Analysis-GlobalOptions
included_headers¶
included_headers : bool = True
symbol_header¶
symbol_header : set[str] = set()
symbols¶
symbols : set[bauhaus.analysis.config.QualifiedName] = {'setlocale'}
system_symbol_header¶
system_symbol_header : set[str] = {'locale'}
translate_header_name¶
translate_header_name : bool = True
stdlib{.h} -> cstdlib).
user_symbol_header¶
user_symbol_header : set[str] = set()