From f24ff6e9b5adc7983c3ad7cf28375eb49921b3ed Mon Sep 17 00:00:00 2001 From: Simon Marchi Date: Fri, 21 Sep 2018 10:27:48 -0400 Subject: [PATCH] csky-opc.h: Initialize fields of last array elements clang gives these errors: In file included from /Users/simark/src/binutils-gdb/opcodes/csky-dis.c:30: /Users/simark/src/binutils-gdb/opcodes/csky-opc.h:2330:8: error: missing field 'transfer' initializer [-Werror,-Wmissing-field-initializers] {NULL} ^ /Users/simark/src/binutils-gdb/opcodes/csky-opc.h:8126:10: error: missing field 'transfer' initializer [-Werror,-Wmissing-field-initializers] {NULL} ^ They go away when we Initialize all fields. I noticed there used to be some files built with -Wno-missing-field-initializers, but it's not the case anymore, since commit e7ae278d0474ab84ba3b1ee932a19e83616ddacc. There is still a NO_WMISSING_FIELD_INITIALIZERS variable defined in the Makefile, but it's unused, so I removed it to avoid further confusion. opcodes/ChangeLog: * Makefile.am: Remove NO_WMISSING_FIELD_INITIALIZERS. * Makefile.in: Re-generate. * aclocal.m4: Re-generate. * configure: Re-generate. * configure.ac: Remove check for -Wno-missing-field-initializers. * csky-opc.h (csky_v1_opcodes): Initialize all fields of last element. (csky_v2_opcodes): Likewise. --- opcodes/ChangeLog | 10 +++++++ opcodes/Makefile.am | 1 - opcodes/Makefile.in | 2 -- opcodes/aclocal.m4 | 1 - opcodes/configure | 62 ++------------------------------------------ opcodes/configure.ac | 2 -- opcodes/csky-opc.h | 4 +-- 7 files changed, 14 insertions(+), 68 deletions(-) diff --git a/opcodes/ChangeLog b/opcodes/ChangeLog index 4edb4e9124c..9f3253165c8 100644 --- a/opcodes/ChangeLog +++ b/opcodes/ChangeLog @@ -1,3 +1,13 @@ +2018-09-21 Simon Marchi + + * Makefile.am: Remove NO_WMISSING_FIELD_INITIALIZERS. + * Makefile.in: Re-generate. + * aclocal.m4: Re-generate. + * configure: Re-generate. + * configure.ac: Remove check for -Wno-missing-field-initializers. + * csky-opc.h (csky_v1_opcodes): Initialize all fields of last element. + (csky_v2_opcodes): Likewise. + 2018-09-20 Maciej W. Rozycki * arc-nps400-tbl.h: Append `ull' to large constants throughout. diff --git a/opcodes/Makefile.am b/opcodes/Makefile.am index 53cd4b3c6e0..cf26ddf4bc3 100644 --- a/opcodes/Makefile.am +++ b/opcodes/Makefile.am @@ -28,7 +28,6 @@ BFDDIR = $(srcdir)/../bfd WARN_CFLAGS = @WARN_CFLAGS@ NO_WERROR = @NO_WERROR@ -NO_WMISSING_FIELD_INITIALIZERS = @NO_WMISSING_FIELD_INITIALIZERS@ AM_CFLAGS = $(WARN_CFLAGS) COMPILE_FOR_BUILD = $(CC_FOR_BUILD) $(INCLUDES) $(AM_CPPFLAGS) \ diff --git a/opcodes/Makefile.in b/opcodes/Makefile.in index 4d9b8180982..34a34df0175 100644 --- a/opcodes/Makefile.in +++ b/opcodes/Makefile.in @@ -121,7 +121,6 @@ am__aclocal_m4_deps = $(top_srcdir)/../bfd/acinclude.m4 \ $(top_srcdir)/../config/override.m4 \ $(top_srcdir)/../config/po.m4 \ $(top_srcdir)/../config/progtest.m4 \ - $(top_srcdir)/../config/warnings.m4 \ $(top_srcdir)/../libtool.m4 $(top_srcdir)/../ltoptions.m4 \ $(top_srcdir)/../ltsugar.m4 $(top_srcdir)/../ltversion.m4 \ $(top_srcdir)/../lt~obsolete.m4 \ @@ -331,7 +330,6 @@ MSGMERGE = @MSGMERGE@ NM = @NM@ NMEDIT = @NMEDIT@ NO_WERROR = @NO_WERROR@ -NO_WMISSING_FIELD_INITIALIZERS = @NO_WMISSING_FIELD_INITIALIZERS@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OTOOL = @OTOOL@ diff --git a/opcodes/aclocal.m4 b/opcodes/aclocal.m4 index 0828c5f456e..36b1327569b 100644 --- a/opcodes/aclocal.m4 +++ b/opcodes/aclocal.m4 @@ -1177,7 +1177,6 @@ m4_include([../config/nls.m4]) m4_include([../config/override.m4]) m4_include([../config/po.m4]) m4_include([../config/progtest.m4]) -m4_include([../config/warnings.m4]) m4_include([../libtool.m4]) m4_include([../ltoptions.m4]) m4_include([../ltsugar.m4]) diff --git a/opcodes/configure b/opcodes/configure index 29b46909c42..389e5513cf9 100755 --- a/opcodes/configure +++ b/opcodes/configure @@ -671,7 +671,6 @@ INSTALL_LIBBFD_TRUE MAINT MAINTAINER_MODE_FALSE MAINTAINER_MODE_TRUE -NO_WMISSING_FIELD_INITIALIZERS WARN_WRITE_STRINGS NO_WERROR WARN_CFLAGS_FOR_BUILD @@ -11440,7 +11439,7 @@ else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext <<_LT_EOF -#line 11443 "configure" +#line 11442 "configure" #include "confdefs.h" #if HAVE_DLFCN_H @@ -11546,7 +11545,7 @@ else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext <<_LT_EOF -#line 11549 "configure" +#line 11548 "configure" #include "confdefs.h" #if HAVE_DLFCN_H @@ -11946,63 +11945,6 @@ fi -ac_ext=c -ac_cpp='$CPP $CPPFLAGS' -ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_c_compiler_gnu - -NO_WMISSING_FIELD_INITIALIZERS= -save_CFLAGS="$CFLAGS" -for real_option in -Wno-missing-field-initializers; do - # Do the check with the no- prefix removed since gcc silently - # accepts any -Wno-* option on purpose - case $real_option in - -Wno-*) option=-W`expr x$real_option : 'x-Wno-\(.*\)'` ;; - *) option=$real_option ;; - esac - as_acx_Woption=`$as_echo "acx_cv_prog_cc_warning_$option" | $as_tr_sh` - - { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC supports $option" >&5 -$as_echo_n "checking whether $CC supports $option... " >&6; } -if eval \${$as_acx_Woption+:} false; then : - $as_echo_n "(cached) " >&6 -else - CFLAGS="$option" - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -int -main () -{ - - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - eval "$as_acx_Woption=yes" -else - eval "$as_acx_Woption=no" -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - -fi -eval ac_res=\$$as_acx_Woption - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } - if test `eval 'as_val=${'$as_acx_Woption'};$as_echo "$as_val"'` = yes; then : - NO_WMISSING_FIELD_INITIALIZERS="$NO_WMISSING_FIELD_INITIALIZERS${NO_WMISSING_FIELD_INITIALIZERS:+ }$real_option" -fi - done -CFLAGS="$save_CFLAGS" -ac_ext=c -ac_cpp='$CPP $CPPFLAGS' -ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_c_compiler_gnu - - ac_config_headers="$ac_config_headers config.h:config.in" diff --git a/opcodes/configure.ac b/opcodes/configure.ac index d4e45f19877..4c3698356bb 100644 --- a/opcodes/configure.ac +++ b/opcodes/configure.ac @@ -51,8 +51,6 @@ AC_ARG_ENABLE(targets, esac])dnl AM_BINUTILS_WARNINGS -ACX_PROG_CC_WARNING_OPTS([-Wno-missing-field-initializers], - [NO_WMISSING_FIELD_INITIALIZERS]) AC_CONFIG_HEADERS(config.h:config.in) diff --git a/opcodes/csky-opc.h b/opcodes/csky-opc.h index e31378c27e7..d2da3e5b06d 100644 --- a/opcodes/csky-opc.h +++ b/opcodes/csky-opc.h @@ -2327,7 +2327,7 @@ const struct csky_opcode csky_v1_opcodes[] = (NONE, FEREG, OPRND_SHIFT_0_BIT)), CSKY_ISA_FLOAT_E1, v1_work_fpu_readd), - {NULL} + {NULL, 0, {}, {}, 0, 0, 0, 0, 0, NULL} }; #undef _TRANSFER @@ -8123,5 +8123,5 @@ const struct csky_opcode csky_v2_opcodes[] = OPCODE_INFO1 (0xc4007c40, (0_4or16_20, DUP_AREG, OPRND_SHIFT_0_BIT)), CSKYV2_ISA_1E2), - {NULL} + {NULL, 0, {}, {}, 0, 0, 0, 0, 0, NULL} }; -- 2.30.2