From d4bdca038e8685af3043683a881af37489fc1827 Mon Sep 17 00:00:00 2001 From: Ian Lance Taylor Date: Thu, 11 Jul 2024 16:07:06 -0700 Subject: [PATCH] libbacktrace: fix testsuite for clang * btest.c (test1, test3): Add optnone attribute. * edtest.c (test1): Likewise. * mtest.c (test1, test3): Likewise. * configure.ac: Use -Wno-attributes and -Wno-unknown-attributes. * configure: Regenerate. --- btest.c | 4 ++-- configure | 3 ++- configure.ac | 3 ++- edtest.c | 2 +- mtest.c | 4 ++-- 5 files changed, 9 insertions(+), 7 deletions(-) diff --git a/btest.c b/btest.c index 9f9c03b..d755484 100644 --- a/btest.c +++ b/btest.c @@ -48,7 +48,7 @@ POSSIBILITY OF SUCH DAMAGE. */ /* Test the backtrace function with non-inlined functions. */ -static int test1 (void) __attribute__ ((noinline, noclone, unused)); +static int test1 (void) __attribute__ ((noinline, noclone, optnone, unused)); static int f2 (int) __attribute__ ((noinline, noclone)); static int f3 (int, int) __attribute__ ((noinline, noclone)); @@ -162,7 +162,7 @@ f13 (int f1line, int f2line) /* Test the backtrace_simple function with non-inlined functions. */ -static int test3 (void) __attribute__ ((noinline, noclone, unused)); +static int test3 (void) __attribute__ ((noinline, noclone, optnone, unused)); static int f22 (int) __attribute__ ((noinline, noclone)); static int f23 (int, int) __attribute__ ((noinline, noclone)); diff --git a/configure b/configure index 88a84a5..69ff2ae 100755 --- a/configure +++ b/configure @@ -11931,7 +11931,8 @@ WARN_FLAGS= save_CFLAGS="$CFLAGS" for real_option in -W -Wall -Wwrite-strings -Wstrict-prototypes \ -Wmissing-prototypes -Wold-style-definition \ - -Wmissing-format-attribute -Wcast-qual; do + -Wmissing-format-attribute -Wcast-qual \ + -Wno-attributes -Wno-unknown-attributes; do # Do the check with the no- prefix removed since gcc silently # accepts any -Wno-* option on purpose case $real_option in diff --git a/configure.ac b/configure.ac index 3d796bd..fb8da30 100644 --- a/configure.ac +++ b/configure.ac @@ -142,7 +142,8 @@ AC_SUBST(EXTRA_FLAGS) ACX_PROG_CC_WARNING_OPTS([-W -Wall -Wwrite-strings -Wstrict-prototypes \ -Wmissing-prototypes -Wold-style-definition \ - -Wmissing-format-attribute -Wcast-qual], + -Wmissing-format-attribute -Wcast-qual \ + -Wno-attributes -Wno-unknown-attributes], [WARN_FLAGS]) AC_ARG_ENABLE([werror], diff --git a/edtest.c b/edtest.c index c5ced13..1be130c 100644 --- a/edtest.c +++ b/edtest.c @@ -43,7 +43,7 @@ POSSIBILITY OF SUCH DAMAGE. */ #include "testlib.h" -static int test1 (void) __attribute__ ((noinline, noclone, unused)); +static int test1 (void) __attribute__ ((noinline, noclone, optnone, unused)); extern int f2 (int); extern int f3 (int, int); diff --git a/mtest.c b/mtest.c index 7e0189a..359da1f 100644 --- a/mtest.c +++ b/mtest.c @@ -47,7 +47,7 @@ POSSIBILITY OF SUCH DAMAGE. */ #include "testlib.h" -static int test1 (void) __attribute__ ((noinline, noclone, unused)); +static int test1 (void) __attribute__ ((noinline, noclone, optnone, unused)); static int f2 (int) __attribute__ ((noinline, noclone)); static int f3 (int, int) __attribute__ ((noinline, noclone)); @@ -211,7 +211,7 @@ f3 (int f1line __attribute__ ((unused)), int f2line __attribute__ ((unused))) /* Test the backtrace_simple function with non-inlined functions. */ -static int test3 (void) __attribute__ ((noinline, noclone, unused)); +static int test3 (void) __attribute__ ((noinline, noclone, optnone, unused)); static int f22 (int) __attribute__ ((noinline, noclone)); static int f23 (int, int) __attribute__ ((noinline, noclone));