public inbox for glibc-cvs@sourceware.org
help / color / mirror / Atom feed
* [glibc/azanella/clang] libio: Handle -Wno-restrict with libc-diag.h
@ 2022-06-03 14:08 Adhemerval Zanella
0 siblings, 0 replies; 13+ messages in thread
From: Adhemerval Zanella @ 2022-06-03 14:08 UTC (permalink / raw)
To: glibc-cvs
https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=2e98add539ce2d46da81d006a1464817f8ef1153
commit 2e98add539ce2d46da81d006a1464817f8ef1153
Author: Adhemerval Zanella <adhemerval.zanella@linaro.org>
Date: Thu Mar 24 16:14:56 2022 -0300
libio: Handle -Wno-restrict with libc-diag.h
Diff:
---
libio/Makefile | 4 ----
libio/tst-sprintf-ub.c | 14 ++++++++++++++
2 files changed, 14 insertions(+), 4 deletions(-)
diff --git a/libio/Makefile b/libio/Makefile
index 3d26a0ed25..e614d6f934 100644
--- a/libio/Makefile
+++ b/libio/Makefile
@@ -165,10 +165,6 @@ CFLAGS-iofputs_u.c += $(config-cflags-wno-ignored-attributes)
CFLAGS-tst_putwc.c += -DOBJPFX=\"$(objpfx)\"
-# These test cases intentionally use overlapping arguments
-CFLAGS-tst-sprintf-ub.c += -Wno-restrict
-CFLAGS-tst-sprintf-chk-ub.c += -Wno-restrict
-
LDFLAGS-tst-bz24228 = -Wl,--version-script=tst-bz24228.map
tst_wprintf2-ARGS = "Some Text"
diff --git a/libio/tst-sprintf-ub.c b/libio/tst-sprintf-ub.c
index 55f341eadb..e6baa4fe6c 100644
--- a/libio/tst-sprintf-ub.c
+++ b/libio/tst-sprintf-ub.c
@@ -16,8 +16,14 @@
License along with the GNU C Library; if not, see
<https://www.gnu.org/licenses/>. */
+#include <libc-diag.h>
#include <stdarg.h>
+/* This is required to disable the overlap warnings for the fortify
+ test. */
+DIAG_PUSH_NEEDS_COMMENT;
+DIAG_IGNORE_NEEDS_COMMENT_GCC (5, "-Wrestrict");
#include <stdio.h>
+DIAG_POP_NEEDS_COMMENT;
#include <string.h>
#include <support/check.h>
@@ -54,7 +60,11 @@ do_one_test (int function, char *buf, ...)
/* The regular sprintf and vsprintf functions do not override the
destination buffer, even if source and destination overlap. */
case FUNCTION_SPRINTF:
+ /* This intentionally use overlapping arguments. */
+ DIAG_PUSH_NEEDS_COMMENT;
+ DIAG_IGNORE_NEEDS_COMMENT_GCC (5, "-Wrestrict");
sprintf (buf, "%sCD", buf);
+ DIAG_POP_NEEDS_COMMENT;
TEST_COMPARE_STRING (buf, expected);
break;
case FUNCTION_VSPRINTF:
@@ -66,7 +76,11 @@ do_one_test (int function, char *buf, ...)
/* On the other hand, snprint and vsnprint override overlapping
source and destination buffers. */
case FUNCTION_SNPRINF:
+ /* This intentionally use overlapping arguments. */
+ DIAG_PUSH_NEEDS_COMMENT;
+ DIAG_IGNORE_NEEDS_COMMENT_GCC (5, "-Wrestrict");
snprintf (buf, 3, "%sCD", buf);
+ DIAG_POP_NEEDS_COMMENT;
TEST_COMPARE_STRING (buf, "CD");
break;
case FUNCTION_VSNPRINTF:
^ permalink raw reply [flat|nested] 13+ messages in thread
* [glibc/azanella/clang] libio: Handle -Wno-restrict with libc-diag.h
@ 2023-02-09 19:51 Adhemerval Zanella
0 siblings, 0 replies; 13+ messages in thread
From: Adhemerval Zanella @ 2023-02-09 19:51 UTC (permalink / raw)
To: glibc-cvs
https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=371c6fe9d24e33ed8b3f0ac9a5dd0a170be4fafd
commit 371c6fe9d24e33ed8b3f0ac9a5dd0a170be4fafd
Author: Adhemerval Zanella <adhemerval.zanella@linaro.org>
Date: Thu Mar 24 16:14:56 2022 -0300
libio: Handle -Wno-restrict with libc-diag.h
Diff:
---
libio/Makefile | 4 ----
libio/tst-sprintf-ub.c | 14 ++++++++++++++
2 files changed, 14 insertions(+), 4 deletions(-)
diff --git a/libio/Makefile b/libio/Makefile
index 2877fec484..2ac4a6f3a4 100644
--- a/libio/Makefile
+++ b/libio/Makefile
@@ -167,10 +167,6 @@ CFLAGS-iofputs_u.c += $(config-cflags-wno-ignored-attributes)
CFLAGS-tst_putwc.c += -DOBJPFX=\"$(objpfx)\"
-# These test cases intentionally use overlapping arguments
-CFLAGS-tst-sprintf-ub.c += -Wno-restrict
-CFLAGS-tst-sprintf-chk-ub.c += -Wno-restrict
-
LDFLAGS-tst-bz24228 = -Wl,--version-script=tst-bz24228.map
tst_wprintf2-ARGS = "Some Text"
diff --git a/libio/tst-sprintf-ub.c b/libio/tst-sprintf-ub.c
index 69cfc9f758..a5801da02d 100644
--- a/libio/tst-sprintf-ub.c
+++ b/libio/tst-sprintf-ub.c
@@ -16,8 +16,14 @@
License along with the GNU C Library; if not, see
<https://www.gnu.org/licenses/>. */
+#include <libc-diag.h>
#include <stdarg.h>
+/* This is required to disable the overlap warnings for the fortify
+ test. */
+DIAG_PUSH_NEEDS_COMMENT;
+DIAG_IGNORE_NEEDS_COMMENT_GCC (5, "-Wrestrict");
#include <stdio.h>
+DIAG_POP_NEEDS_COMMENT;
#include <string.h>
#include <support/check.h>
@@ -54,7 +60,11 @@ do_one_test (int function, char *buf, ...)
/* The regular sprintf and vsprintf functions do not override the
destination buffer, even if source and destination overlap. */
case FUNCTION_SPRINTF:
+ /* This intentionally use overlapping arguments. */
+ DIAG_PUSH_NEEDS_COMMENT;
+ DIAG_IGNORE_NEEDS_COMMENT_GCC (5, "-Wrestrict");
sprintf (buf, "%sCD", buf);
+ DIAG_POP_NEEDS_COMMENT;
TEST_COMPARE_STRING (buf, expected);
break;
case FUNCTION_VSPRINTF:
@@ -66,7 +76,11 @@ do_one_test (int function, char *buf, ...)
/* On the other hand, snprint and vsnprint override overlapping
source and destination buffers. */
case FUNCTION_SNPRINF:
+ /* This intentionally use overlapping arguments. */
+ DIAG_PUSH_NEEDS_COMMENT;
+ DIAG_IGNORE_NEEDS_COMMENT_GCC (5, "-Wrestrict");
snprintf (buf, 3, "%sCD", buf);
+ DIAG_POP_NEEDS_COMMENT;
TEST_COMPARE_STRING (buf, "CD");
break;
case FUNCTION_VSNPRINTF:
^ permalink raw reply [flat|nested] 13+ messages in thread
* [glibc/azanella/clang] libio: Handle -Wno-restrict with libc-diag.h
@ 2022-10-28 17:44 Adhemerval Zanella
0 siblings, 0 replies; 13+ messages in thread
From: Adhemerval Zanella @ 2022-10-28 17:44 UTC (permalink / raw)
To: glibc-cvs
https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=a8e7af8af1036bf21a66e3d3fab00137b7a52970
commit a8e7af8af1036bf21a66e3d3fab00137b7a52970
Author: Adhemerval Zanella <adhemerval.zanella@linaro.org>
Date: Thu Mar 24 16:14:56 2022 -0300
libio: Handle -Wno-restrict with libc-diag.h
Diff:
---
libio/Makefile | 4 ----
libio/tst-sprintf-ub.c | 14 ++++++++++++++
2 files changed, 14 insertions(+), 4 deletions(-)
diff --git a/libio/Makefile b/libio/Makefile
index 64398ab1ee..7c91ebcec0 100644
--- a/libio/Makefile
+++ b/libio/Makefile
@@ -165,10 +165,6 @@ CFLAGS-iofputs_u.c += $(config-cflags-wno-ignored-attributes)
CFLAGS-tst_putwc.c += -DOBJPFX=\"$(objpfx)\"
-# These test cases intentionally use overlapping arguments
-CFLAGS-tst-sprintf-ub.c += -Wno-restrict
-CFLAGS-tst-sprintf-chk-ub.c += -Wno-restrict
-
LDFLAGS-tst-bz24228 = -Wl,--version-script=tst-bz24228.map
tst_wprintf2-ARGS = "Some Text"
diff --git a/libio/tst-sprintf-ub.c b/libio/tst-sprintf-ub.c
index 55f341eadb..e6baa4fe6c 100644
--- a/libio/tst-sprintf-ub.c
+++ b/libio/tst-sprintf-ub.c
@@ -16,8 +16,14 @@
License along with the GNU C Library; if not, see
<https://www.gnu.org/licenses/>. */
+#include <libc-diag.h>
#include <stdarg.h>
+/* This is required to disable the overlap warnings for the fortify
+ test. */
+DIAG_PUSH_NEEDS_COMMENT;
+DIAG_IGNORE_NEEDS_COMMENT_GCC (5, "-Wrestrict");
#include <stdio.h>
+DIAG_POP_NEEDS_COMMENT;
#include <string.h>
#include <support/check.h>
@@ -54,7 +60,11 @@ do_one_test (int function, char *buf, ...)
/* The regular sprintf and vsprintf functions do not override the
destination buffer, even if source and destination overlap. */
case FUNCTION_SPRINTF:
+ /* This intentionally use overlapping arguments. */
+ DIAG_PUSH_NEEDS_COMMENT;
+ DIAG_IGNORE_NEEDS_COMMENT_GCC (5, "-Wrestrict");
sprintf (buf, "%sCD", buf);
+ DIAG_POP_NEEDS_COMMENT;
TEST_COMPARE_STRING (buf, expected);
break;
case FUNCTION_VSPRINTF:
@@ -66,7 +76,11 @@ do_one_test (int function, char *buf, ...)
/* On the other hand, snprint and vsnprint override overlapping
source and destination buffers. */
case FUNCTION_SNPRINF:
+ /* This intentionally use overlapping arguments. */
+ DIAG_PUSH_NEEDS_COMMENT;
+ DIAG_IGNORE_NEEDS_COMMENT_GCC (5, "-Wrestrict");
snprintf (buf, 3, "%sCD", buf);
+ DIAG_POP_NEEDS_COMMENT;
TEST_COMPARE_STRING (buf, "CD");
break;
case FUNCTION_VSNPRINTF:
^ permalink raw reply [flat|nested] 13+ messages in thread
* [glibc/azanella/clang] libio: Handle -Wno-restrict with libc-diag.h
@ 2022-10-04 13:02 Adhemerval Zanella
0 siblings, 0 replies; 13+ messages in thread
From: Adhemerval Zanella @ 2022-10-04 13:02 UTC (permalink / raw)
To: glibc-cvs
https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=1fdf898431043ad6fd1a0252b9b122a80130569a
commit 1fdf898431043ad6fd1a0252b9b122a80130569a
Author: Adhemerval Zanella <adhemerval.zanella@linaro.org>
Date: Thu Mar 24 16:14:56 2022 -0300
libio: Handle -Wno-restrict with libc-diag.h
Diff:
---
libio/Makefile | 4 ----
libio/tst-sprintf-ub.c | 14 ++++++++++++++
2 files changed, 14 insertions(+), 4 deletions(-)
diff --git a/libio/Makefile b/libio/Makefile
index 64398ab1ee..7c91ebcec0 100644
--- a/libio/Makefile
+++ b/libio/Makefile
@@ -165,10 +165,6 @@ CFLAGS-iofputs_u.c += $(config-cflags-wno-ignored-attributes)
CFLAGS-tst_putwc.c += -DOBJPFX=\"$(objpfx)\"
-# These test cases intentionally use overlapping arguments
-CFLAGS-tst-sprintf-ub.c += -Wno-restrict
-CFLAGS-tst-sprintf-chk-ub.c += -Wno-restrict
-
LDFLAGS-tst-bz24228 = -Wl,--version-script=tst-bz24228.map
tst_wprintf2-ARGS = "Some Text"
diff --git a/libio/tst-sprintf-ub.c b/libio/tst-sprintf-ub.c
index 55f341eadb..e6baa4fe6c 100644
--- a/libio/tst-sprintf-ub.c
+++ b/libio/tst-sprintf-ub.c
@@ -16,8 +16,14 @@
License along with the GNU C Library; if not, see
<https://www.gnu.org/licenses/>. */
+#include <libc-diag.h>
#include <stdarg.h>
+/* This is required to disable the overlap warnings for the fortify
+ test. */
+DIAG_PUSH_NEEDS_COMMENT;
+DIAG_IGNORE_NEEDS_COMMENT_GCC (5, "-Wrestrict");
#include <stdio.h>
+DIAG_POP_NEEDS_COMMENT;
#include <string.h>
#include <support/check.h>
@@ -54,7 +60,11 @@ do_one_test (int function, char *buf, ...)
/* The regular sprintf and vsprintf functions do not override the
destination buffer, even if source and destination overlap. */
case FUNCTION_SPRINTF:
+ /* This intentionally use overlapping arguments. */
+ DIAG_PUSH_NEEDS_COMMENT;
+ DIAG_IGNORE_NEEDS_COMMENT_GCC (5, "-Wrestrict");
sprintf (buf, "%sCD", buf);
+ DIAG_POP_NEEDS_COMMENT;
TEST_COMPARE_STRING (buf, expected);
break;
case FUNCTION_VSPRINTF:
@@ -66,7 +76,11 @@ do_one_test (int function, char *buf, ...)
/* On the other hand, snprint and vsnprint override overlapping
source and destination buffers. */
case FUNCTION_SNPRINF:
+ /* This intentionally use overlapping arguments. */
+ DIAG_PUSH_NEEDS_COMMENT;
+ DIAG_IGNORE_NEEDS_COMMENT_GCC (5, "-Wrestrict");
snprintf (buf, 3, "%sCD", buf);
+ DIAG_POP_NEEDS_COMMENT;
TEST_COMPARE_STRING (buf, "CD");
break;
case FUNCTION_VSNPRINTF:
^ permalink raw reply [flat|nested] 13+ messages in thread
* [glibc/azanella/clang] libio: Handle -Wno-restrict with libc-diag.h
@ 2022-06-09 21:22 Adhemerval Zanella
0 siblings, 0 replies; 13+ messages in thread
From: Adhemerval Zanella @ 2022-06-09 21:22 UTC (permalink / raw)
To: glibc-cvs
https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=b9751c7856124e58e4135b41b9c297948c242a4e
commit b9751c7856124e58e4135b41b9c297948c242a4e
Author: Adhemerval Zanella <adhemerval.zanella@linaro.org>
Date: Thu Mar 24 16:14:56 2022 -0300
libio: Handle -Wno-restrict with libc-diag.h
Diff:
---
libio/Makefile | 4 ----
libio/tst-sprintf-ub.c | 14 ++++++++++++++
2 files changed, 14 insertions(+), 4 deletions(-)
diff --git a/libio/Makefile b/libio/Makefile
index 3d26a0ed25..e614d6f934 100644
--- a/libio/Makefile
+++ b/libio/Makefile
@@ -165,10 +165,6 @@ CFLAGS-iofputs_u.c += $(config-cflags-wno-ignored-attributes)
CFLAGS-tst_putwc.c += -DOBJPFX=\"$(objpfx)\"
-# These test cases intentionally use overlapping arguments
-CFLAGS-tst-sprintf-ub.c += -Wno-restrict
-CFLAGS-tst-sprintf-chk-ub.c += -Wno-restrict
-
LDFLAGS-tst-bz24228 = -Wl,--version-script=tst-bz24228.map
tst_wprintf2-ARGS = "Some Text"
diff --git a/libio/tst-sprintf-ub.c b/libio/tst-sprintf-ub.c
index 55f341eadb..e6baa4fe6c 100644
--- a/libio/tst-sprintf-ub.c
+++ b/libio/tst-sprintf-ub.c
@@ -16,8 +16,14 @@
License along with the GNU C Library; if not, see
<https://www.gnu.org/licenses/>. */
+#include <libc-diag.h>
#include <stdarg.h>
+/* This is required to disable the overlap warnings for the fortify
+ test. */
+DIAG_PUSH_NEEDS_COMMENT;
+DIAG_IGNORE_NEEDS_COMMENT_GCC (5, "-Wrestrict");
#include <stdio.h>
+DIAG_POP_NEEDS_COMMENT;
#include <string.h>
#include <support/check.h>
@@ -54,7 +60,11 @@ do_one_test (int function, char *buf, ...)
/* The regular sprintf and vsprintf functions do not override the
destination buffer, even if source and destination overlap. */
case FUNCTION_SPRINTF:
+ /* This intentionally use overlapping arguments. */
+ DIAG_PUSH_NEEDS_COMMENT;
+ DIAG_IGNORE_NEEDS_COMMENT_GCC (5, "-Wrestrict");
sprintf (buf, "%sCD", buf);
+ DIAG_POP_NEEDS_COMMENT;
TEST_COMPARE_STRING (buf, expected);
break;
case FUNCTION_VSPRINTF:
@@ -66,7 +76,11 @@ do_one_test (int function, char *buf, ...)
/* On the other hand, snprint and vsnprint override overlapping
source and destination buffers. */
case FUNCTION_SNPRINF:
+ /* This intentionally use overlapping arguments. */
+ DIAG_PUSH_NEEDS_COMMENT;
+ DIAG_IGNORE_NEEDS_COMMENT_GCC (5, "-Wrestrict");
snprintf (buf, 3, "%sCD", buf);
+ DIAG_POP_NEEDS_COMMENT;
TEST_COMPARE_STRING (buf, "CD");
break;
case FUNCTION_VSNPRINTF:
^ permalink raw reply [flat|nested] 13+ messages in thread
* [glibc/azanella/clang] libio: Handle -Wno-restrict with libc-diag.h
@ 2022-06-09 13:19 Adhemerval Zanella
0 siblings, 0 replies; 13+ messages in thread
From: Adhemerval Zanella @ 2022-06-09 13:19 UTC (permalink / raw)
To: glibc-cvs
https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=b9751c7856124e58e4135b41b9c297948c242a4e
commit b9751c7856124e58e4135b41b9c297948c242a4e
Author: Adhemerval Zanella <adhemerval.zanella@linaro.org>
Date: Thu Mar 24 16:14:56 2022 -0300
libio: Handle -Wno-restrict with libc-diag.h
Diff:
---
libio/Makefile | 4 ----
libio/tst-sprintf-ub.c | 14 ++++++++++++++
2 files changed, 14 insertions(+), 4 deletions(-)
diff --git a/libio/Makefile b/libio/Makefile
index 3d26a0ed25..e614d6f934 100644
--- a/libio/Makefile
+++ b/libio/Makefile
@@ -165,10 +165,6 @@ CFLAGS-iofputs_u.c += $(config-cflags-wno-ignored-attributes)
CFLAGS-tst_putwc.c += -DOBJPFX=\"$(objpfx)\"
-# These test cases intentionally use overlapping arguments
-CFLAGS-tst-sprintf-ub.c += -Wno-restrict
-CFLAGS-tst-sprintf-chk-ub.c += -Wno-restrict
-
LDFLAGS-tst-bz24228 = -Wl,--version-script=tst-bz24228.map
tst_wprintf2-ARGS = "Some Text"
diff --git a/libio/tst-sprintf-ub.c b/libio/tst-sprintf-ub.c
index 55f341eadb..e6baa4fe6c 100644
--- a/libio/tst-sprintf-ub.c
+++ b/libio/tst-sprintf-ub.c
@@ -16,8 +16,14 @@
License along with the GNU C Library; if not, see
<https://www.gnu.org/licenses/>. */
+#include <libc-diag.h>
#include <stdarg.h>
+/* This is required to disable the overlap warnings for the fortify
+ test. */
+DIAG_PUSH_NEEDS_COMMENT;
+DIAG_IGNORE_NEEDS_COMMENT_GCC (5, "-Wrestrict");
#include <stdio.h>
+DIAG_POP_NEEDS_COMMENT;
#include <string.h>
#include <support/check.h>
@@ -54,7 +60,11 @@ do_one_test (int function, char *buf, ...)
/* The regular sprintf and vsprintf functions do not override the
destination buffer, even if source and destination overlap. */
case FUNCTION_SPRINTF:
+ /* This intentionally use overlapping arguments. */
+ DIAG_PUSH_NEEDS_COMMENT;
+ DIAG_IGNORE_NEEDS_COMMENT_GCC (5, "-Wrestrict");
sprintf (buf, "%sCD", buf);
+ DIAG_POP_NEEDS_COMMENT;
TEST_COMPARE_STRING (buf, expected);
break;
case FUNCTION_VSPRINTF:
@@ -66,7 +76,11 @@ do_one_test (int function, char *buf, ...)
/* On the other hand, snprint and vsnprint override overlapping
source and destination buffers. */
case FUNCTION_SNPRINF:
+ /* This intentionally use overlapping arguments. */
+ DIAG_PUSH_NEEDS_COMMENT;
+ DIAG_IGNORE_NEEDS_COMMENT_GCC (5, "-Wrestrict");
snprintf (buf, 3, "%sCD", buf);
+ DIAG_POP_NEEDS_COMMENT;
TEST_COMPARE_STRING (buf, "CD");
break;
case FUNCTION_VSNPRINTF:
^ permalink raw reply [flat|nested] 13+ messages in thread
* [glibc/azanella/clang] libio: Handle -Wno-restrict with libc-diag.h
@ 2022-05-13 14:22 Adhemerval Zanella
0 siblings, 0 replies; 13+ messages in thread
From: Adhemerval Zanella @ 2022-05-13 14:22 UTC (permalink / raw)
To: glibc-cvs
https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=d2db79f692e3e1d8f3fa4872b6e076513b84ba32
commit d2db79f692e3e1d8f3fa4872b6e076513b84ba32
Author: Adhemerval Zanella <adhemerval.zanella@linaro.org>
Date: Thu Mar 24 16:14:56 2022 -0300
libio: Handle -Wno-restrict with libc-diag.h
Diff:
---
libio/Makefile | 4 ----
libio/tst-sprintf-ub.c | 14 ++++++++++++++
2 files changed, 14 insertions(+), 4 deletions(-)
diff --git a/libio/Makefile b/libio/Makefile
index 3d26a0ed25..e614d6f934 100644
--- a/libio/Makefile
+++ b/libio/Makefile
@@ -165,10 +165,6 @@ CFLAGS-iofputs_u.c += $(config-cflags-wno-ignored-attributes)
CFLAGS-tst_putwc.c += -DOBJPFX=\"$(objpfx)\"
-# These test cases intentionally use overlapping arguments
-CFLAGS-tst-sprintf-ub.c += -Wno-restrict
-CFLAGS-tst-sprintf-chk-ub.c += -Wno-restrict
-
LDFLAGS-tst-bz24228 = -Wl,--version-script=tst-bz24228.map
tst_wprintf2-ARGS = "Some Text"
diff --git a/libio/tst-sprintf-ub.c b/libio/tst-sprintf-ub.c
index 55f341eadb..e6baa4fe6c 100644
--- a/libio/tst-sprintf-ub.c
+++ b/libio/tst-sprintf-ub.c
@@ -16,8 +16,14 @@
License along with the GNU C Library; if not, see
<https://www.gnu.org/licenses/>. */
+#include <libc-diag.h>
#include <stdarg.h>
+/* This is required to disable the overlap warnings for the fortify
+ test. */
+DIAG_PUSH_NEEDS_COMMENT;
+DIAG_IGNORE_NEEDS_COMMENT_GCC (5, "-Wrestrict");
#include <stdio.h>
+DIAG_POP_NEEDS_COMMENT;
#include <string.h>
#include <support/check.h>
@@ -54,7 +60,11 @@ do_one_test (int function, char *buf, ...)
/* The regular sprintf and vsprintf functions do not override the
destination buffer, even if source and destination overlap. */
case FUNCTION_SPRINTF:
+ /* This intentionally use overlapping arguments. */
+ DIAG_PUSH_NEEDS_COMMENT;
+ DIAG_IGNORE_NEEDS_COMMENT_GCC (5, "-Wrestrict");
sprintf (buf, "%sCD", buf);
+ DIAG_POP_NEEDS_COMMENT;
TEST_COMPARE_STRING (buf, expected);
break;
case FUNCTION_VSPRINTF:
@@ -66,7 +76,11 @@ do_one_test (int function, char *buf, ...)
/* On the other hand, snprint and vsnprint override overlapping
source and destination buffers. */
case FUNCTION_SNPRINF:
+ /* This intentionally use overlapping arguments. */
+ DIAG_PUSH_NEEDS_COMMENT;
+ DIAG_IGNORE_NEEDS_COMMENT_GCC (5, "-Wrestrict");
snprintf (buf, 3, "%sCD", buf);
+ DIAG_POP_NEEDS_COMMENT;
TEST_COMPARE_STRING (buf, "CD");
break;
case FUNCTION_VSNPRINTF:
^ permalink raw reply [flat|nested] 13+ messages in thread
* [glibc/azanella/clang] libio: Handle -Wno-restrict with libc-diag.h
@ 2022-05-12 19:36 Adhemerval Zanella
0 siblings, 0 replies; 13+ messages in thread
From: Adhemerval Zanella @ 2022-05-12 19:36 UTC (permalink / raw)
To: glibc-cvs
https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=82999b9df2ef6932f77d0129120893cb959681c9
commit 82999b9df2ef6932f77d0129120893cb959681c9
Author: Adhemerval Zanella <adhemerval.zanella@linaro.org>
Date: Thu Mar 24 16:14:56 2022 -0300
libio: Handle -Wno-restrict with libc-diag.h
Diff:
---
libio/Makefile | 4 ----
libio/tst-sprintf-ub.c | 14 ++++++++++++++
2 files changed, 14 insertions(+), 4 deletions(-)
diff --git a/libio/Makefile b/libio/Makefile
index 3d26a0ed25..e614d6f934 100644
--- a/libio/Makefile
+++ b/libio/Makefile
@@ -165,10 +165,6 @@ CFLAGS-iofputs_u.c += $(config-cflags-wno-ignored-attributes)
CFLAGS-tst_putwc.c += -DOBJPFX=\"$(objpfx)\"
-# These test cases intentionally use overlapping arguments
-CFLAGS-tst-sprintf-ub.c += -Wno-restrict
-CFLAGS-tst-sprintf-chk-ub.c += -Wno-restrict
-
LDFLAGS-tst-bz24228 = -Wl,--version-script=tst-bz24228.map
tst_wprintf2-ARGS = "Some Text"
diff --git a/libio/tst-sprintf-ub.c b/libio/tst-sprintf-ub.c
index 55f341eadb..e6baa4fe6c 100644
--- a/libio/tst-sprintf-ub.c
+++ b/libio/tst-sprintf-ub.c
@@ -16,8 +16,14 @@
License along with the GNU C Library; if not, see
<https://www.gnu.org/licenses/>. */
+#include <libc-diag.h>
#include <stdarg.h>
+/* This is required to disable the overlap warnings for the fortify
+ test. */
+DIAG_PUSH_NEEDS_COMMENT;
+DIAG_IGNORE_NEEDS_COMMENT_GCC (5, "-Wrestrict");
#include <stdio.h>
+DIAG_POP_NEEDS_COMMENT;
#include <string.h>
#include <support/check.h>
@@ -54,7 +60,11 @@ do_one_test (int function, char *buf, ...)
/* The regular sprintf and vsprintf functions do not override the
destination buffer, even if source and destination overlap. */
case FUNCTION_SPRINTF:
+ /* This intentionally use overlapping arguments. */
+ DIAG_PUSH_NEEDS_COMMENT;
+ DIAG_IGNORE_NEEDS_COMMENT_GCC (5, "-Wrestrict");
sprintf (buf, "%sCD", buf);
+ DIAG_POP_NEEDS_COMMENT;
TEST_COMPARE_STRING (buf, expected);
break;
case FUNCTION_VSPRINTF:
@@ -66,7 +76,11 @@ do_one_test (int function, char *buf, ...)
/* On the other hand, snprint and vsnprint override overlapping
source and destination buffers. */
case FUNCTION_SNPRINF:
+ /* This intentionally use overlapping arguments. */
+ DIAG_PUSH_NEEDS_COMMENT;
+ DIAG_IGNORE_NEEDS_COMMENT_GCC (5, "-Wrestrict");
snprintf (buf, 3, "%sCD", buf);
+ DIAG_POP_NEEDS_COMMENT;
TEST_COMPARE_STRING (buf, "CD");
break;
case FUNCTION_VSNPRINTF:
^ permalink raw reply [flat|nested] 13+ messages in thread
* [glibc/azanella/clang] libio: Handle -Wno-restrict with libc-diag.h
@ 2022-05-10 18:26 Adhemerval Zanella
0 siblings, 0 replies; 13+ messages in thread
From: Adhemerval Zanella @ 2022-05-10 18:26 UTC (permalink / raw)
To: glibc-cvs
https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=04ec8a0a9745ad9cd5b6d6017091484537199002
commit 04ec8a0a9745ad9cd5b6d6017091484537199002
Author: Adhemerval Zanella <adhemerval.zanella@linaro.org>
Date: Thu Mar 24 16:14:56 2022 -0300
libio: Handle -Wno-restrict with libc-diag.h
Diff:
---
libio/Makefile | 4 ----
libio/tst-sprintf-ub.c | 14 ++++++++++++++
2 files changed, 14 insertions(+), 4 deletions(-)
diff --git a/libio/Makefile b/libio/Makefile
index 3d26a0ed25..e614d6f934 100644
--- a/libio/Makefile
+++ b/libio/Makefile
@@ -165,10 +165,6 @@ CFLAGS-iofputs_u.c += $(config-cflags-wno-ignored-attributes)
CFLAGS-tst_putwc.c += -DOBJPFX=\"$(objpfx)\"
-# These test cases intentionally use overlapping arguments
-CFLAGS-tst-sprintf-ub.c += -Wno-restrict
-CFLAGS-tst-sprintf-chk-ub.c += -Wno-restrict
-
LDFLAGS-tst-bz24228 = -Wl,--version-script=tst-bz24228.map
tst_wprintf2-ARGS = "Some Text"
diff --git a/libio/tst-sprintf-ub.c b/libio/tst-sprintf-ub.c
index 55f341eadb..e6baa4fe6c 100644
--- a/libio/tst-sprintf-ub.c
+++ b/libio/tst-sprintf-ub.c
@@ -16,8 +16,14 @@
License along with the GNU C Library; if not, see
<https://www.gnu.org/licenses/>. */
+#include <libc-diag.h>
#include <stdarg.h>
+/* This is required to disable the overlap warnings for the fortify
+ test. */
+DIAG_PUSH_NEEDS_COMMENT;
+DIAG_IGNORE_NEEDS_COMMENT_GCC (5, "-Wrestrict");
#include <stdio.h>
+DIAG_POP_NEEDS_COMMENT;
#include <string.h>
#include <support/check.h>
@@ -54,7 +60,11 @@ do_one_test (int function, char *buf, ...)
/* The regular sprintf and vsprintf functions do not override the
destination buffer, even if source and destination overlap. */
case FUNCTION_SPRINTF:
+ /* This intentionally use overlapping arguments. */
+ DIAG_PUSH_NEEDS_COMMENT;
+ DIAG_IGNORE_NEEDS_COMMENT_GCC (5, "-Wrestrict");
sprintf (buf, "%sCD", buf);
+ DIAG_POP_NEEDS_COMMENT;
TEST_COMPARE_STRING (buf, expected);
break;
case FUNCTION_VSPRINTF:
@@ -66,7 +76,11 @@ do_one_test (int function, char *buf, ...)
/* On the other hand, snprint and vsnprint override overlapping
source and destination buffers. */
case FUNCTION_SNPRINF:
+ /* This intentionally use overlapping arguments. */
+ DIAG_PUSH_NEEDS_COMMENT;
+ DIAG_IGNORE_NEEDS_COMMENT_GCC (5, "-Wrestrict");
snprintf (buf, 3, "%sCD", buf);
+ DIAG_POP_NEEDS_COMMENT;
TEST_COMPARE_STRING (buf, "CD");
break;
case FUNCTION_VSNPRINTF:
^ permalink raw reply [flat|nested] 13+ messages in thread
* [glibc/azanella/clang] libio: Handle -Wno-restrict with libc-diag.h
@ 2022-04-29 14:06 Adhemerval Zanella
0 siblings, 0 replies; 13+ messages in thread
From: Adhemerval Zanella @ 2022-04-29 14:06 UTC (permalink / raw)
To: glibc-cvs
https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=42f39af2190588221f285124c559483946df5675
commit 42f39af2190588221f285124c559483946df5675
Author: Adhemerval Zanella <adhemerval.zanella@linaro.org>
Date: Thu Mar 24 16:14:56 2022 -0300
libio: Handle -Wno-restrict with libc-diag.h
Diff:
---
libio/Makefile | 4 ----
libio/tst-sprintf-ub.c | 14 ++++++++++++++
2 files changed, 14 insertions(+), 4 deletions(-)
diff --git a/libio/Makefile b/libio/Makefile
index 3d26a0ed25..e614d6f934 100644
--- a/libio/Makefile
+++ b/libio/Makefile
@@ -165,10 +165,6 @@ CFLAGS-iofputs_u.c += $(config-cflags-wno-ignored-attributes)
CFLAGS-tst_putwc.c += -DOBJPFX=\"$(objpfx)\"
-# These test cases intentionally use overlapping arguments
-CFLAGS-tst-sprintf-ub.c += -Wno-restrict
-CFLAGS-tst-sprintf-chk-ub.c += -Wno-restrict
-
LDFLAGS-tst-bz24228 = -Wl,--version-script=tst-bz24228.map
tst_wprintf2-ARGS = "Some Text"
diff --git a/libio/tst-sprintf-ub.c b/libio/tst-sprintf-ub.c
index 55f341eadb..e6baa4fe6c 100644
--- a/libio/tst-sprintf-ub.c
+++ b/libio/tst-sprintf-ub.c
@@ -16,8 +16,14 @@
License along with the GNU C Library; if not, see
<https://www.gnu.org/licenses/>. */
+#include <libc-diag.h>
#include <stdarg.h>
+/* This is required to disable the overlap warnings for the fortify
+ test. */
+DIAG_PUSH_NEEDS_COMMENT;
+DIAG_IGNORE_NEEDS_COMMENT_GCC (5, "-Wrestrict");
#include <stdio.h>
+DIAG_POP_NEEDS_COMMENT;
#include <string.h>
#include <support/check.h>
@@ -54,7 +60,11 @@ do_one_test (int function, char *buf, ...)
/* The regular sprintf and vsprintf functions do not override the
destination buffer, even if source and destination overlap. */
case FUNCTION_SPRINTF:
+ /* This intentionally use overlapping arguments. */
+ DIAG_PUSH_NEEDS_COMMENT;
+ DIAG_IGNORE_NEEDS_COMMENT_GCC (5, "-Wrestrict");
sprintf (buf, "%sCD", buf);
+ DIAG_POP_NEEDS_COMMENT;
TEST_COMPARE_STRING (buf, expected);
break;
case FUNCTION_VSPRINTF:
@@ -66,7 +76,11 @@ do_one_test (int function, char *buf, ...)
/* On the other hand, snprint and vsnprint override overlapping
source and destination buffers. */
case FUNCTION_SNPRINF:
+ /* This intentionally use overlapping arguments. */
+ DIAG_PUSH_NEEDS_COMMENT;
+ DIAG_IGNORE_NEEDS_COMMENT_GCC (5, "-Wrestrict");
snprintf (buf, 3, "%sCD", buf);
+ DIAG_POP_NEEDS_COMMENT;
TEST_COMPARE_STRING (buf, "CD");
break;
case FUNCTION_VSNPRINTF:
^ permalink raw reply [flat|nested] 13+ messages in thread
* [glibc/azanella/clang] libio: Handle -Wno-restrict with libc-diag.h
@ 2022-04-04 12:57 Adhemerval Zanella
0 siblings, 0 replies; 13+ messages in thread
From: Adhemerval Zanella @ 2022-04-04 12:57 UTC (permalink / raw)
To: glibc-cvs
https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=101415f84019496c96355ac8e581412b7a333fff
commit 101415f84019496c96355ac8e581412b7a333fff
Author: Adhemerval Zanella <adhemerval.zanella@linaro.org>
Date: Thu Mar 24 16:14:56 2022 -0300
libio: Handle -Wno-restrict with libc-diag.h
Diff:
---
libio/Makefile | 4 ----
libio/tst-sprintf-ub.c | 14 ++++++++++++++
2 files changed, 14 insertions(+), 4 deletions(-)
diff --git a/libio/Makefile b/libio/Makefile
index 3d26a0ed25..e614d6f934 100644
--- a/libio/Makefile
+++ b/libio/Makefile
@@ -165,10 +165,6 @@ CFLAGS-iofputs_u.c += $(config-cflags-wno-ignored-attributes)
CFLAGS-tst_putwc.c += -DOBJPFX=\"$(objpfx)\"
-# These test cases intentionally use overlapping arguments
-CFLAGS-tst-sprintf-ub.c += -Wno-restrict
-CFLAGS-tst-sprintf-chk-ub.c += -Wno-restrict
-
LDFLAGS-tst-bz24228 = -Wl,--version-script=tst-bz24228.map
tst_wprintf2-ARGS = "Some Text"
diff --git a/libio/tst-sprintf-ub.c b/libio/tst-sprintf-ub.c
index 55f341eadb..e6baa4fe6c 100644
--- a/libio/tst-sprintf-ub.c
+++ b/libio/tst-sprintf-ub.c
@@ -16,8 +16,14 @@
License along with the GNU C Library; if not, see
<https://www.gnu.org/licenses/>. */
+#include <libc-diag.h>
#include <stdarg.h>
+/* This is required to disable the overlap warnings for the fortify
+ test. */
+DIAG_PUSH_NEEDS_COMMENT;
+DIAG_IGNORE_NEEDS_COMMENT_GCC (5, "-Wrestrict");
#include <stdio.h>
+DIAG_POP_NEEDS_COMMENT;
#include <string.h>
#include <support/check.h>
@@ -54,7 +60,11 @@ do_one_test (int function, char *buf, ...)
/* The regular sprintf and vsprintf functions do not override the
destination buffer, even if source and destination overlap. */
case FUNCTION_SPRINTF:
+ /* This intentionally use overlapping arguments. */
+ DIAG_PUSH_NEEDS_COMMENT;
+ DIAG_IGNORE_NEEDS_COMMENT_GCC (5, "-Wrestrict");
sprintf (buf, "%sCD", buf);
+ DIAG_POP_NEEDS_COMMENT;
TEST_COMPARE_STRING (buf, expected);
break;
case FUNCTION_VSPRINTF:
@@ -66,7 +76,11 @@ do_one_test (int function, char *buf, ...)
/* On the other hand, snprint and vsnprint override overlapping
source and destination buffers. */
case FUNCTION_SNPRINF:
+ /* This intentionally use overlapping arguments. */
+ DIAG_PUSH_NEEDS_COMMENT;
+ DIAG_IGNORE_NEEDS_COMMENT_GCC (5, "-Wrestrict");
snprintf (buf, 3, "%sCD", buf);
+ DIAG_POP_NEEDS_COMMENT;
TEST_COMPARE_STRING (buf, "CD");
break;
case FUNCTION_VSNPRINTF:
^ permalink raw reply [flat|nested] 13+ messages in thread
* [glibc/azanella/clang] libio: Handle -Wno-restrict with libc-diag.h
@ 2022-03-31 19:09 Adhemerval Zanella
0 siblings, 0 replies; 13+ messages in thread
From: Adhemerval Zanella @ 2022-03-31 19:09 UTC (permalink / raw)
To: glibc-cvs
https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=a6b78fe83d0b92cc34417ad67f6c479f11f66619
commit a6b78fe83d0b92cc34417ad67f6c479f11f66619
Author: Adhemerval Zanella <adhemerval.zanella@linaro.org>
Date: Thu Mar 24 16:14:56 2022 -0300
libio: Handle -Wno-restrict with libc-diag.h
Diff:
---
libio/Makefile | 4 ----
libio/tst-sprintf-ub.c | 14 ++++++++++++++
2 files changed, 14 insertions(+), 4 deletions(-)
diff --git a/libio/Makefile b/libio/Makefile
index 3d26a0ed25..e614d6f934 100644
--- a/libio/Makefile
+++ b/libio/Makefile
@@ -165,10 +165,6 @@ CFLAGS-iofputs_u.c += $(config-cflags-wno-ignored-attributes)
CFLAGS-tst_putwc.c += -DOBJPFX=\"$(objpfx)\"
-# These test cases intentionally use overlapping arguments
-CFLAGS-tst-sprintf-ub.c += -Wno-restrict
-CFLAGS-tst-sprintf-chk-ub.c += -Wno-restrict
-
LDFLAGS-tst-bz24228 = -Wl,--version-script=tst-bz24228.map
tst_wprintf2-ARGS = "Some Text"
diff --git a/libio/tst-sprintf-ub.c b/libio/tst-sprintf-ub.c
index 55f341eadb..e6baa4fe6c 100644
--- a/libio/tst-sprintf-ub.c
+++ b/libio/tst-sprintf-ub.c
@@ -16,8 +16,14 @@
License along with the GNU C Library; if not, see
<https://www.gnu.org/licenses/>. */
+#include <libc-diag.h>
#include <stdarg.h>
+/* This is required to disable the overlap warnings for the fortify
+ test. */
+DIAG_PUSH_NEEDS_COMMENT;
+DIAG_IGNORE_NEEDS_COMMENT_GCC (5, "-Wrestrict");
#include <stdio.h>
+DIAG_POP_NEEDS_COMMENT;
#include <string.h>
#include <support/check.h>
@@ -54,7 +60,11 @@ do_one_test (int function, char *buf, ...)
/* The regular sprintf and vsprintf functions do not override the
destination buffer, even if source and destination overlap. */
case FUNCTION_SPRINTF:
+ /* This intentionally use overlapping arguments. */
+ DIAG_PUSH_NEEDS_COMMENT;
+ DIAG_IGNORE_NEEDS_COMMENT_GCC (5, "-Wrestrict");
sprintf (buf, "%sCD", buf);
+ DIAG_POP_NEEDS_COMMENT;
TEST_COMPARE_STRING (buf, expected);
break;
case FUNCTION_VSPRINTF:
@@ -66,7 +76,11 @@ do_one_test (int function, char *buf, ...)
/* On the other hand, snprint and vsnprint override overlapping
source and destination buffers. */
case FUNCTION_SNPRINF:
+ /* This intentionally use overlapping arguments. */
+ DIAG_PUSH_NEEDS_COMMENT;
+ DIAG_IGNORE_NEEDS_COMMENT_GCC (5, "-Wrestrict");
snprintf (buf, 3, "%sCD", buf);
+ DIAG_POP_NEEDS_COMMENT;
TEST_COMPARE_STRING (buf, "CD");
break;
case FUNCTION_VSNPRINTF:
^ permalink raw reply [flat|nested] 13+ messages in thread
* [glibc/azanella/clang] libio: Handle -Wno-restrict with libc-diag.h
@ 2022-03-29 20:32 Adhemerval Zanella
0 siblings, 0 replies; 13+ messages in thread
From: Adhemerval Zanella @ 2022-03-29 20:32 UTC (permalink / raw)
To: glibc-cvs
https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=50eea5434de5713707e73a4a55655e9f466de13e
commit 50eea5434de5713707e73a4a55655e9f466de13e
Author: Adhemerval Zanella <adhemerval.zanella@linaro.org>
Date: Thu Mar 24 16:14:56 2022 -0300
libio: Handle -Wno-restrict with libc-diag.h
Diff:
---
libio/Makefile | 4 ----
libio/tst-sprintf-ub.c | 14 ++++++++++++++
2 files changed, 14 insertions(+), 4 deletions(-)
diff --git a/libio/Makefile b/libio/Makefile
index 3d26a0ed25..e614d6f934 100644
--- a/libio/Makefile
+++ b/libio/Makefile
@@ -165,10 +165,6 @@ CFLAGS-iofputs_u.c += $(config-cflags-wno-ignored-attributes)
CFLAGS-tst_putwc.c += -DOBJPFX=\"$(objpfx)\"
-# These test cases intentionally use overlapping arguments
-CFLAGS-tst-sprintf-ub.c += -Wno-restrict
-CFLAGS-tst-sprintf-chk-ub.c += -Wno-restrict
-
LDFLAGS-tst-bz24228 = -Wl,--version-script=tst-bz24228.map
tst_wprintf2-ARGS = "Some Text"
diff --git a/libio/tst-sprintf-ub.c b/libio/tst-sprintf-ub.c
index 55f341eadb..e6baa4fe6c 100644
--- a/libio/tst-sprintf-ub.c
+++ b/libio/tst-sprintf-ub.c
@@ -16,8 +16,14 @@
License along with the GNU C Library; if not, see
<https://www.gnu.org/licenses/>. */
+#include <libc-diag.h>
#include <stdarg.h>
+/* This is required to disable the overlap warnings for the fortify
+ test. */
+DIAG_PUSH_NEEDS_COMMENT;
+DIAG_IGNORE_NEEDS_COMMENT_GCC (5, "-Wrestrict");
#include <stdio.h>
+DIAG_POP_NEEDS_COMMENT;
#include <string.h>
#include <support/check.h>
@@ -54,7 +60,11 @@ do_one_test (int function, char *buf, ...)
/* The regular sprintf and vsprintf functions do not override the
destination buffer, even if source and destination overlap. */
case FUNCTION_SPRINTF:
+ /* This intentionally use overlapping arguments. */
+ DIAG_PUSH_NEEDS_COMMENT;
+ DIAG_IGNORE_NEEDS_COMMENT_GCC (5, "-Wrestrict");
sprintf (buf, "%sCD", buf);
+ DIAG_POP_NEEDS_COMMENT;
TEST_COMPARE_STRING (buf, expected);
break;
case FUNCTION_VSPRINTF:
@@ -66,7 +76,11 @@ do_one_test (int function, char *buf, ...)
/* On the other hand, snprint and vsnprint override overlapping
source and destination buffers. */
case FUNCTION_SNPRINF:
+ /* This intentionally use overlapping arguments. */
+ DIAG_PUSH_NEEDS_COMMENT;
+ DIAG_IGNORE_NEEDS_COMMENT_GCC (5, "-Wrestrict");
snprintf (buf, 3, "%sCD", buf);
+ DIAG_POP_NEEDS_COMMENT;
TEST_COMPARE_STRING (buf, "CD");
break;
case FUNCTION_VSNPRINTF:
^ permalink raw reply [flat|nested] 13+ messages in thread
end of thread, other threads:[~2023-02-09 19:51 UTC | newest]
Thread overview: 13+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-06-03 14:08 [glibc/azanella/clang] libio: Handle -Wno-restrict with libc-diag.h Adhemerval Zanella
-- strict thread matches above, loose matches on Subject: below --
2023-02-09 19:51 Adhemerval Zanella
2022-10-28 17:44 Adhemerval Zanella
2022-10-04 13:02 Adhemerval Zanella
2022-06-09 21:22 Adhemerval Zanella
2022-06-09 13:19 Adhemerval Zanella
2022-05-13 14:22 Adhemerval Zanella
2022-05-12 19:36 Adhemerval Zanella
2022-05-10 18:26 Adhemerval Zanella
2022-04-29 14:06 Adhemerval Zanella
2022-04-04 12:57 Adhemerval Zanella
2022-03-31 19:09 Adhemerval Zanella
2022-03-29 20:32 Adhemerval Zanella
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).