csky-opc.h: Initialize fields of last array elements
authorSimon Marchi <simon.marchi@ericsson.com>
Fri, 21 Sep 2018 14:27:48 +0000 (10:27 -0400)
committerSimon Marchi <simon.marchi@ericsson.com>
Fri, 21 Sep 2018 14:27:49 +0000 (10:27 -0400)
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
opcodes/Makefile.am
opcodes/Makefile.in
opcodes/aclocal.m4
opcodes/configure
opcodes/configure.ac
opcodes/csky-opc.h

index 4edb4e9124c58bb6b092f2815e6cd136ce2940ed..9f3253165c8c084d68eeef13f4078d862bc4b880 100644 (file)
@@ -1,3 +1,13 @@
+2018-09-21  Simon Marchi  <simon.marchi@ericsson.com>
+
+       * 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  <macro@linux-mips.org>
 
        * arc-nps400-tbl.h: Append `ull' to large constants throughout.
index 53cd4b3c6e069bf0d27f1cba1a9d6409709c40d7..cf26ddf4bc34b2c8f50af86b010f65667288fda8 100644 (file)
@@ -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) \
index 4d9b8180982eeea056cab2cd4b3f7301b9578fd6..34a34df0175164e0cebc3285971c0cc62459e9d7 100644 (file)
@@ -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@
index 0828c5f456e1f228722db6a3363ab3958701e221..36b1327569b261b3b05a91539a8af68c6d2e2b43 100644 (file)
@@ -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])
index 29b46909c420ed0ee64177f49b80ce5101570f6d..389e5513cf9a5904b2a08541eef6c5c528007bd8 100755 (executable)
@@ -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
 
 
 
-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"
 
index d4e45f198776bd4abe4261c5d10be3f765482b38..4c3698356bbf8d81ab2f909d45b21fb6c9862a6d 100644 (file)
@@ -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)
 
index e31378c27e78285d74945774f87e42a119e0a248..d2da3e5b06ddb5232c9bc30bdd0a0ea5cecea163 100644 (file)
@@ -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}
   };