Skip to content

Commit 073eaa2

Browse files
Fix #1869 Compiler Compatability for clang for CERT-C++ rule DCL51-CPP
tzname is char*[2] in the standard libraries of both clang and gcc. This will allow the test code to compile, and still triggers a non-compliance query result.
1 parent 29ade52 commit 073eaa2

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
| test.cpp:18:5:18:10 | tzname | The variable $@ reuses a reserved standard library name. | test.cpp:18:5:18:10 | tzname | tzname |
1+
| test.cpp:18:7:18:12 | tzname | The variable $@ reuses a reserved standard library name. | test.cpp:18:7:18:12 | tzname | tzname |

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

Lines changed: 1 addition & 1 deletion
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-
int tzname = 0; // NON_COMPLIANT
18+
char* tzname[2]; // NON_COMPLIANT
1919

2020
void min() {} // NON_COMPLIANT
2121

0 commit comments

Comments
 (0)