Accepting request 593526 from devel:gcc

- Add some -Wno-error flags for gcc-8 compatibility.

OBS-URL: https://build.opensuse.org/request/show/593526
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/gdb?expand=0&rev=120
This commit is contained in:
Yuchen Lin 2018-04-10 07:50:43 +00:00 committed by Git OBS Bridge
commit 23fd00c6f6
2 changed files with 20 additions and 5 deletions

View File

@ -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

View File

@ -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:
# -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 -Wno-implicit-fallthrough 2>&1 | \
grep Wno-implici >/dev/null; then
CFLAGS="$CFLAGS -Wno-implicit-fallthrough"
$CC -x c -c - -o /dev/null -W ${opt} 2>&1 | \
egrep "Wno|no option" >/dev/null; then
CFLAGS="$CFLAGS ${opt}"
fi
done
%if %{have_libipt}
CFLAGS="$CFLAGS -DPERF_ATTR_SIZE_VER5_BUNDLE"
(