Skip to content

Commit 96b85e0

Browse files
committed
A18-0-3: Address compiler compatibility
Move global locale definitions to locale.h, and import them into std with "using" to better reflect real compilers.
1 parent b9f8bde commit 96b85e0

File tree

4 files changed

+21
-16
lines changed

4 files changed

+21
-16
lines changed

cpp/autosar/test/rules/A18-0-3/LocaleFunctionsUsed.expected

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
1-
| test.cpp:4:3:4:16 | call to setlocale | Use of <clocale> function 'std::setlocale'. |
2-
| test.cpp:5:3:5:16 | call to setlocale | Use of <clocale> function 'std::setlocale'. |
3-
| test.cpp:6:3:6:16 | call to setlocale | Use of <clocale> function 'std::setlocale'. |
4-
| test.cpp:7:3:7:16 | call to setlocale | Use of <clocale> function 'std::setlocale'. |
5-
| test.cpp:8:3:8:16 | call to setlocale | Use of <clocale> function 'std::setlocale'. |
6-
| test.cpp:9:3:9:16 | call to setlocale | Use of <clocale> function 'std::setlocale'. |
7-
| test.cpp:10:20:10:34 | call to localeconv | Use of <clocale> function 'std::localeconv'. |
1+
| test.cpp:4:3:4:16 | call to setlocale | Use of <clocale> function 'setlocale'. |
2+
| test.cpp:5:3:5:16 | call to setlocale | Use of <clocale> function 'setlocale'. |
3+
| test.cpp:6:3:6:16 | call to setlocale | Use of <clocale> function 'setlocale'. |
4+
| test.cpp:7:3:7:16 | call to setlocale | Use of <clocale> function 'setlocale'. |
5+
| test.cpp:8:3:8:16 | call to setlocale | Use of <clocale> function 'setlocale'. |
6+
| test.cpp:9:3:9:16 | call to setlocale | Use of <clocale> function 'setlocale'. |
7+
| test.cpp:10:20:10:34 | call to localeconv | Use of <clocale> function 'localeconv'. |
88
| test.cpp:12:3:12:11 | call to setlocale | Use of <clocale> function 'setlocale'. |
99
| test.cpp:13:3:13:11 | call to setlocale | Use of <clocale> function 'setlocale'. |
1010
| test.cpp:14:3:14:11 | call to setlocale | Use of <clocale> function 'setlocale'. |
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
| test.cpp:10:8:10:12 | type mention | Use of <clocale> type 'std::lconv'. |
1+
| test.cpp:10:8:10:12 | type mention | Use of <clocale> type 'lconv'. |
22
| test.cpp:18:3:18:7 | type mention | Use of <clocale> type 'lconv'. |

cpp/common/test/includes/standard-library/clocale

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -8,13 +8,10 @@
88
#define LC_NUMERIC 0
99
#define LC_TIME 0
1010

11+
#include <locale.h>
12+
1113
namespace std {
12-
struct lconv;
13-
char *setlocale(int, const char *);
14-
lconv *localeconv();
14+
using ::lconv;
15+
using ::localeconv;
16+
using ::setlocale;
1517
} // namespace std
16-
17-
// global namespace
18-
struct lconv;
19-
char *setlocale(int, const char *);
20-
lconv *localeconv();
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
#ifndef _GHLIBCPP_LOCALE
2+
#define _GHLIBCPP_LOCALE
3+
4+
struct lconv;
5+
char *setlocale(int, const char *);
6+
lconv *localeconv();
7+
8+
#endif // _GHLIBCPP_LOCALE

0 commit comments

Comments
 (0)