From 45cbf065f2771122bdc261c220a4fe0369a4136c56b0a0c61d8353ec3554fc31 Mon Sep 17 00:00:00 2001 From: Michael Matz Date: Tue, 27 Mar 2018 14:02:35 +0000 Subject: [PATCH 1/2] - Add some -Wno-error flags for gcc-8 compatibility. OBS-URL: https://build.opensuse.org/package/show/devel:gcc/gdb?expand=0&rev=181 --- gdb.changes | 5 +++++ gdb.spec | 20 +++++++++++++++----- 2 files changed, 20 insertions(+), 5 deletions(-) diff --git a/gdb.changes b/gdb.changes index 9c1f0b7..49a4676 100644 --- a/gdb.changes +++ b/gdb.changes @@ -1,3 +1,8 @@ +------------------------------------------------------------------- +Tue Mar 27 14:01:27 UTC 2018 - matz@suse.com + +- Add some -Wno-error flags for gcc-8 compatibility. + ------------------------------------------------------------------- Fri Mar 9 16:27:10 UTC 2018 - matz@suse.com diff --git a/gdb.spec b/gdb.spec index 0b76d19..626f3cd 100644 --- a/gdb.spec +++ b/gdb.spec @@ -590,11 +590,21 @@ export CFLAGS="$RPM_OPT_FLAGS" # warn about unknown -Wno- flags, _except_ if there are other # diagnostics as well, so let's force an uninitialized use warning # and grep for the diagnostic about the -Wno flag: -if ! echo "int foo(void) { int a; return a;} " | \ - $CC -x c -c - -o /dev/null -W -Wno-implicit-fallthrough 2>&1 | \ - grep Wno-implici >/dev/null; then - CFLAGS="$CFLAGS -Wno-implicit-fallthrough" -fi +# -Wno-error=cast-function-type: +# FIXME: gcc-8.0: +# ./elf32-target.h:215:4: error: cast between incompatible function types from 'void * (*)(bfd *)' {aka 'void * (*)(struct bfd *)'} to 'asymbol * (*)(bfd *, void *, long unsigned int)' {aka 'struct bfd_symbol * (*)(struc t bfd *, void *, long unsigned int)'} [-Werror=cast-function-type] +# ((asymbol * (*) (bfd *, void *, unsigned long)) bfd_nullvoidptr) +# -Wno-error=stringop-truncation: +# FIXME: gcc-8.0: +# linux-tdep.c:1767:11: error: ‘char* strncpy(char*, const char*, size_t)’ specified bound 17 equals destination size [-Werror=stringop-truncation] +# strncpy (p->pr_fname, basename, sizeof (p->pr_fname)); +for opt in -Wno-implicit-fallthrough -Wno-error=cast-function-type -Wno-error=stringop-truncation; do + if ! echo "int foo(void) { int a; return a;} " | \ + $CC -x c -c - -o /dev/null -W ${opt} 2>&1 | \ + grep Wno >/dev/null; then + CFLAGS="$CFLAGS ${opt}" + fi +done %if %{have_libipt} CFLAGS="$CFLAGS -DPERF_ATTR_SIZE_VER5_BUNDLE" ( From 945af33f4df221fa42760984cfcbeb81b894c73ef7d9b62b30b8f7939c85bb53 Mon Sep 17 00:00:00 2001 From: Michael Matz Date: Tue, 27 Mar 2018 15:55:16 +0000 Subject: [PATCH 2/2] . OBS-URL: https://build.opensuse.org/package/show/devel:gcc/gdb?expand=0&rev=182 --- gdb.spec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gdb.spec b/gdb.spec index 626f3cd..010155a 100644 --- a/gdb.spec +++ b/gdb.spec @@ -601,7 +601,7 @@ export CFLAGS="$RPM_OPT_FLAGS" for opt in -Wno-implicit-fallthrough -Wno-error=cast-function-type -Wno-error=stringop-truncation; do if ! echo "int foo(void) { int a; return a;} " | \ $CC -x c -c - -o /dev/null -W ${opt} 2>&1 | \ - grep Wno >/dev/null; then + egrep "Wno|no option" >/dev/null; then CFLAGS="$CFLAGS ${opt}" fi done