Skip to content

Commit 8a20d0e

Browse files
Use namespace, to ensure tzname definition is distinct from std time.
1 parent 8734672 commit 8a20d0e

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
| test.cpp:18:7:18:12 | tzname | The variable $@ reuses a reserved standard library name. | test.cpp:18:7:18:12 | tzname | tzname |
1+
| test.cpp:18:20:18:25 | tzname | The variable $@ reuses a reserved standard library name. | test.cpp:18:20:18:25 | tzname | tzname |

cpp/cert/test/rules/DCL51-CPP/test.cpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ enum {
1515

1616
// int NULL = 0; // NON_COMPLIANT, but not supported by compilers in practice
1717

18-
char *tzname[2]; // NON_COMPLIANT
18+
namespace ns { int tzname = 0; } // NON_COMPLIANT
1919

2020
void min() {} // NON_COMPLIANT
2121

@@ -48,4 +48,4 @@ void test_lambda(const int y) {
4848
// Lambda generates a static function called `_FUN` when the lambda is
4949
// converted to a function pointer
5050
g([](int x) { return x; }); // COMPLIANT - compiler generated
51-
}
51+
}

0 commit comments

Comments
 (0)