Skip to content

Commit 08a261e

Browse files
committed
A26-5-1: Address compiler compatibility
Move "rand" definition to the global namespace and import into std with "using", to better reflect "real" compilers.
1 parent 39f8f98 commit 08a261e

File tree

3 files changed

+4
-2
lines changed

3 files changed

+4
-2
lines changed

cpp/common/test/includes/standard-library/cstdlib.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,10 @@ namespace std {
77
[[noreturn]] void quick_exit(int status) noexcept;
88
extern "C++" int atexit(void (*f)(void)) noexcept;
99
extern "C++" int at_quick_exit(void (*f)(void)) noexcept;
10-
extern "C++" long rand() noexcept;
1110
using ::atof;
1211
using ::atoi;
1312
using ::atol;
1413
using ::atoll;
14+
using ::rand;
1515
} // namespace std
1616
#endif // _GHLIBCPP_CSTDLIB

cpp/common/test/includes/standard-library/stdlib.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,4 +20,6 @@ long int atol(const char *str);
2020
long long int atoll(const char *str);
2121
double atof(const char *str);
2222

23+
int rand(void);
24+
2325
#endif // _GHLIBCPP_STDLIB
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
| test.cpp:5:47:5:55 | call to rand | Use of banned function std::rand. |
1+
| test.cpp:5:47:5:55 | call to rand | Use of banned function rand. |

0 commit comments

Comments
 (0)