Skip to content

Commit 29ec7ce

Browse files
committed
test(unsafe-functions): use clang pragma to downgrade implicit gets declaration diagnostic
1 parent 6d2bb03 commit 29ec7ce

1 file changed

Lines changed: 7 additions & 0 deletions

File tree

‎test/security/unsafe-functions/13_unsafe_functions.c‎

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,14 @@ void vuln_gets(void)
1616
{
1717
char buf[64];
1818
printf("Input: ");
19+
#if defined(__clang__)
20+
#pragma clang diagnostic push
21+
#pragma clang diagnostic warning "-Wimplicit-function-declaration"
22+
#endif
1923
gets(buf); /* CWE-676: aucune limite de taille, overflow garanti */
24+
#if defined(__clang__)
25+
#pragma clang diagnostic pop
26+
#endif
2027
printf("Got: %s\n", buf);
2128
}
2229

0 commit comments

Comments
 (0)