mirror of
git://sourceware.org/git/glibc.git
synced 2025-03-06 20:58:33 +01:00
string: Fix tester build with fortify enable with gcc < 12
When building with fortify enabled, GCC < 12 issues a warning on the fortify strncat wrapper might overflow the destination buffer (the failure is tied to -Werror). Checked on ppc64 and x86_64. Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
This commit is contained in:
parent
f5f96b784b
commit
f1c7ed0859
1 changed files with 8 additions and 3 deletions
|
@ -34,6 +34,14 @@
|
|||
DIAG_IGNORE_NEEDS_COMMENT (8, "-Wstringop-truncation");
|
||||
#endif
|
||||
|
||||
/* When building with fortify enabled, GCC < 12 issues a warning on the
|
||||
fortify strncat wrapper might overflow the destination buffer (the
|
||||
failure is tied to -Werror).
|
||||
Triggered by strncat fortify wrapper when it is enabled. */
|
||||
#if __GNUC_PREREQ (11, 0)
|
||||
DIAG_IGNORE_NEEDS_COMMENT (11, "-Wstringop-overread");
|
||||
#endif
|
||||
|
||||
#include <errno.h>
|
||||
#include <stdint.h>
|
||||
#include <stdio.h>
|
||||
|
@ -52,9 +60,6 @@ DIAG_IGNORE_NEEDS_COMMENT (5.0, "-Wmemset-transposed-args");
|
|||
DIAG_IGNORE_NEEDS_COMMENT (9, "-Wrestrict");
|
||||
DIAG_IGNORE_NEEDS_COMMENT (7, "-Wstringop-overflow=");
|
||||
#endif
|
||||
#if __GNUC_PREREQ (11, 0)
|
||||
DIAG_IGNORE_NEEDS_COMMENT (11, "-Wstringop-overread");
|
||||
#endif
|
||||
|
||||
|
||||
#define STREQ(a, b) (strcmp((a), (b)) == 0)
|
||||
|
|
Loading…
Add table
Reference in a new issue