Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
* [PATCH 2/3] Move gdb/warning.m4 to gdbsupport
  2020-02-10 16:40 [PATCH 1/3] gdbsupport: use AM_GDB_WARNINGS Simon Marchi
@ 2020-02-10 16:40 ` Simon Marchi
  2020-02-11 14:55   ` Tom Tromey
  2020-02-10 16:40 ` [PATCH 3/3] Add -Wstrict-null-sentinel to gdbsupport/warning.m4 Simon Marchi
  2020-02-11 14:55 ` [PATCH 1/3] gdbsupport: use AM_GDB_WARNINGS Tom Tromey
  2 siblings, 1 reply; 9+ messages in thread
From: Simon Marchi @ 2020-02-10 16:40 UTC (permalink / raw)
  To: gdb-patches; +Cc: Simon Marchi

This file is used by gdbsupport, gdbserver and gdb, so I think it
belongs in gdbsupport.  Move it there and update the references the
various acinclude.m4 files.

gdbsupport/ChangeLog:

	* warning.m4: Move here, from gdb/warning.m4.
	* acinclude.m4: Update warning.m4 path.
	* Makefile.in: Re-generate.

gdbserver/ChangeLog:

	* acinclude.m4: Update warning.m4 path.

gdb/ChangeLog:

	* acinclude: Update warning.m4 path.
	* warning.m4: Move to gdbsupport.
---
 gdb/acinclude.m4               | 2 +-
 gdbserver/acinclude.m4         | 4 ++--
 gdbsupport/Makefile.in         | 2 +-
 gdbsupport/acinclude.m4        | 2 +-
 {gdb => gdbsupport}/warning.m4 | 0
 5 files changed, 5 insertions(+), 5 deletions(-)
 rename {gdb => gdbsupport}/warning.m4 (100%)

diff --git a/gdb/acinclude.m4 b/gdb/acinclude.m4
index d60b2fe19c16..14304bbe50ff 100644
--- a/gdb/acinclude.m4
+++ b/gdb/acinclude.m4
@@ -10,7 +10,7 @@ m4_include(acx_configure_dir.m4)
 m4_include(transform.m4)
 
 # This gets AM_GDB_WARNINGS.
-m4_include(warning.m4)
+m4_include(../gdbsupport/warning.m4)
 
 # AM_GDB_UBSAN
 m4_include(sanitize.m4)
diff --git a/gdbserver/acinclude.m4 b/gdbserver/acinclude.m4
index 5a284515c82b..6ed43ddd5219 100644
--- a/gdbserver/acinclude.m4
+++ b/gdbserver/acinclude.m4
@@ -3,8 +3,8 @@ m4_include(../bfd/bfd.m4)
 
 m4_include(../gdb/acx_configure_dir.m4)
 
-# This gets AM_GDB_WARNINGS.
-m4_include(../gdb/warning.m4)
+dnl This gets AM_GDB_WARNINGS.
+m4_include(../gdbsupport/warning.m4)
 
 dnl This gets autoconf bugfixes
 m4_include(../config/override.m4)
diff --git a/gdbsupport/Makefile.in b/gdbsupport/Makefile.in
index 91164175bc04..be4d53545311 100644
--- a/gdbsupport/Makefile.in
+++ b/gdbsupport/Makefile.in
@@ -124,7 +124,7 @@ am__aclocal_m4_deps = $(top_srcdir)/../config/codeset.m4 \
 	$(top_srcdir)/../gdb/ax_cxx_compile_stdcxx.m4 \
 	$(top_srcdir)/../gdb/libiberty.m4 \
 	$(top_srcdir)/../gdb/selftest.m4 \
-	$(top_srcdir)/../gdb/ptrace.m4 $(top_srcdir)/../gdb/warning.m4 \
+	$(top_srcdir)/../gdb/ptrace.m4 $(top_srcdir)/warning.m4 \
 	$(top_srcdir)/configure.ac
 am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
 	$(ACLOCAL_M4)
diff --git a/gdbsupport/acinclude.m4 b/gdbsupport/acinclude.m4
index 3598b201b94b..d638ebcb543a 100644
--- a/gdbsupport/acinclude.m4
+++ b/gdbsupport/acinclude.m4
@@ -7,4 +7,4 @@ m4_include([../gdb/selftest.m4])
 m4_include([../gdb/ptrace.m4])
 
 dnl This gets AM_GDB_WARNINGS.
-m4_include(../gdb/warning.m4)
+m4_include(warning.m4)
diff --git a/gdb/warning.m4 b/gdbsupport/warning.m4
similarity index 100%
rename from gdb/warning.m4
rename to gdbsupport/warning.m4
-- 
2.25.0


^ permalink raw reply	[flat|nested] 9+ messages in thread

* [PATCH 1/3] gdbsupport: use AM_GDB_WARNINGS
@ 2020-02-10 16:40 Simon Marchi
  2020-02-10 16:40 ` [PATCH 2/3] Move gdb/warning.m4 to gdbsupport Simon Marchi
                   ` (2 more replies)
  0 siblings, 3 replies; 9+ messages in thread
From: Simon Marchi @ 2020-02-10 16:40 UTC (permalink / raw)
  To: gdb-patches; +Cc: Simon Marchi

Since gdbsupport has been given its own build system, it is no longer
compiled with the warning flags specified in gdb/warning.m4.

This patch makes it use AM_GDB_WARNINGS.

gdbsupport/ChangeLog:

	* acinclude.m4: Include ../gdb/warning.m4.
	* configure.ac: Use AM_GDB_WARNINGS.
	* Makefile.am: Set AM_CFLAGS to WARN_CFLAGS and WERROR_CFLAGS.
	* Makefile.in: Re-generate.
	* configure: Re-generate.
---
 gdbsupport/Makefile.am  |   2 +
 gdbsupport/Makefile.in  |   6 +-
 gdbsupport/acinclude.m4 |   3 +
 gdbsupport/configure    | 194 ++++++++++++++++++++++++++++++++++++++++
 gdbsupport/configure.ac |   3 +
 5 files changed, 207 insertions(+), 1 deletion(-)

diff --git a/gdbsupport/Makefile.am b/gdbsupport/Makefile.am
index 4b8a604ce52e..cd7b0adf6b4c 100644
--- a/gdbsupport/Makefile.am
+++ b/gdbsupport/Makefile.am
@@ -29,6 +29,8 @@ override CXX += $(CXX_DIALECT)
 override CC := $(CXX)
 override CFLAGS := $(CXXFLAGS)
 
+AM_CFLAGS = $(WARN_CFLAGS) $(WERROR_CFLAGS)
+
 noinst_LIBRARIES = libgdbsupport.a
 
 if SELFTEST
diff --git a/gdbsupport/Makefile.in b/gdbsupport/Makefile.in
index 31065af2440a..91164175bc04 100644
--- a/gdbsupport/Makefile.in
+++ b/gdbsupport/Makefile.in
@@ -124,7 +124,8 @@ am__aclocal_m4_deps = $(top_srcdir)/../config/codeset.m4 \
 	$(top_srcdir)/../gdb/ax_cxx_compile_stdcxx.m4 \
 	$(top_srcdir)/../gdb/libiberty.m4 \
 	$(top_srcdir)/../gdb/selftest.m4 \
-	$(top_srcdir)/../gdb/ptrace.m4 $(top_srcdir)/configure.ac
+	$(top_srcdir)/../gdb/ptrace.m4 $(top_srcdir)/../gdb/warning.m4 \
+	$(top_srcdir)/configure.ac
 am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
 	$(ACLOCAL_M4)
 DIST_COMMON = $(srcdir)/Makefile.am $(top_srcdir)/configure \
@@ -287,6 +288,8 @@ SHELL = @SHELL@
 STRIP = @STRIP@
 USE_NLS = @USE_NLS@
 VERSION = @VERSION@
+WARN_CFLAGS = @WARN_CFLAGS@
+WERROR_CFLAGS = @WERROR_CFLAGS@
 XGETTEXT = @XGETTEXT@
 abs_builddir = @abs_builddir@
 abs_srcdir = @abs_srcdir@
@@ -350,6 +353,7 @@ AM_CPPFLAGS = -I$(srcdir)/../include -I$(srcdir)/../gdb \
     -I../gnulib/import -I$(srcdir)/../gnulib/import \
     -I.. -I$(srcdir)/.. $(INCINTL) -I../bfd -I$(srcdir)/../bfd
 
+AM_CFLAGS = $(WARN_CFLAGS) $(WERROR_CFLAGS)
 noinst_LIBRARIES = libgdbsupport.a
 @SELFTEST_TRUE@selftest = selftest.c
 libgdbsupport_a_SOURCES = \
diff --git a/gdbsupport/acinclude.m4 b/gdbsupport/acinclude.m4
index fe08bb36fe0b..3598b201b94b 100644
--- a/gdbsupport/acinclude.m4
+++ b/gdbsupport/acinclude.m4
@@ -5,3 +5,6 @@ m4_include([../gdb/ax_cxx_compile_stdcxx.m4])
 m4_include([../gdb/libiberty.m4])
 m4_include([../gdb/selftest.m4])
 m4_include([../gdb/ptrace.m4])
+
+dnl This gets AM_GDB_WARNINGS.
+m4_include(../gdb/warning.m4)
diff --git a/gdbsupport/configure b/gdbsupport/configure
index cf943e69ef5c..197749b5d0ca 100755
--- a/gdbsupport/configure
+++ b/gdbsupport/configure
@@ -624,6 +624,8 @@ ac_subst_vars='am__EXEEXT_FALSE
 am__EXEEXT_TRUE
 LTLIBOBJS
 LIBOBJS
+WERROR_CFLAGS
+WARN_CFLAGS
 SELFTEST_FALSE
 SELFTEST_TRUE
 LTLIBIPT
@@ -769,6 +771,9 @@ with_gnu_ld
 enable_rpath
 with_libipt_prefix
 enable_unit_tests
+enable_werror
+enable_build_warnings
+enable_gdb_build_warnings
 '
       ac_precious_vars='build_alias
 host_alias
@@ -1415,6 +1420,11 @@ Optional Features:
   --disable-rpath         do not hardcode runtime library paths
   --enable-unit-tests     Enable the inclusion of unit tests when compiling
                           GDB
+  --enable-werror         treat compile warnings as errors
+  --enable-build-warnings enable build-time compiler warnings if gcc is used
+  --enable-gdb-build-warnings
+                          enable GDB specific build-time compiler warnings if
+                          gcc is used
 
 Optional Packages:
   --with-PACKAGE[=ARG]    use PACKAGE [ARG=yes]
@@ -10806,6 +10816,190 @@ _ACEOF
 fi
 
 
+# Detect support warning flags.
+
+# Check whether --enable-werror was given.
+if test "${enable_werror+set}" = set; then :
+  enableval=$enable_werror; case "${enableval}" in
+     yes | y) ERROR_ON_WARNING="yes" ;;
+     no | n)  ERROR_ON_WARNING="no" ;;
+     *) as_fn_error $? "bad value ${enableval} for --enable-werror" "$LINENO" 5 ;;
+   esac
+fi
+
+
+# Enable -Werror by default when using gcc.  Turn it off for releases.
+if test "${GCC}" = yes -a -z "${ERROR_ON_WARNING}" && $development; then
+    ERROR_ON_WARNING=yes
+fi
+
+WERROR_CFLAGS=""
+if test "${ERROR_ON_WARNING}" = yes ; then
+    WERROR_CFLAGS="-Werror"
+fi
+
+# The options we'll try to enable.
+build_warnings="-Wall -Wpointer-arith \
+-Wno-unused -Wunused-value -Wunused-variable -Wunused-function \
+-Wno-switch -Wno-char-subscripts \
+-Wempty-body -Wunused-but-set-parameter -Wunused-but-set-variable \
+-Wno-sign-compare -Wno-error=maybe-uninitialized \
+-Wno-mismatched-tags \
+-Wno-error=deprecated-register \
+-Wsuggest-override \
+-Wimplicit-fallthrough=3 \
+-Wduplicated-cond \
+-Wshadow=local \
+-Wdeprecated-copy \
+-Wdeprecated-copy-dtor \
+-Wredundant-move \
+-Wmissing-declarations"
+
+case "${host}" in
+  *-*-mingw32*)
+    # Enable -Wno-format by default when using gcc on mingw since many
+    # GCC versions complain about %I64.
+    build_warnings="$build_warnings -Wno-format" ;;
+  *-*-solaris*)
+    # Solaris 11.4 <python2.7/ceval.h> uses #pragma no_inline that GCC
+    # doesn't understand.
+    build_warnings="$build_warnings -Wno-unknown-pragmas"
+    # Solaris 11 <unistd.h> marks vfork deprecated.
+    build_warnings="$build_warnings -Wno-deprecated-declarations" ;;
+  *)
+    # Note that gcc requires -Wformat for -Wformat-nonliteral to work,
+    # but there's a special case for this below.
+    build_warnings="$build_warnings -Wformat-nonliteral" ;;
+esac
+
+# Check whether --enable-build-warnings was given.
+if test "${enable_build_warnings+set}" = set; then :
+  enableval=$enable_build_warnings; case "${enableval}" in
+  yes)	;;
+  no)	build_warnings="-w";;
+  ,*)   t=`echo "${enableval}" | sed -e "s/,/ /g"`
+        build_warnings="${build_warnings} ${t}";;
+  *,)   t=`echo "${enableval}" | sed -e "s/,/ /g"`
+        build_warnings="${t} ${build_warnings}";;
+  *)    build_warnings=`echo "${enableval}" | sed -e "s/,/ /g"`;;
+esac
+if test x"$silent" != x"yes" && test x"$build_warnings" != x""; then
+  echo "Setting compiler warning flags = $build_warnings" 6>&1
+fi
+fi
+# Check whether --enable-gdb-build-warnings was given.
+if test "${enable_gdb_build_warnings+set}" = set; then :
+  enableval=$enable_gdb_build_warnings; case "${enableval}" in
+  yes)	;;
+  no)	build_warnings="-w";;
+  ,*)   t=`echo "${enableval}" | sed -e "s/,/ /g"`
+        build_warnings="${build_warnings} ${t}";;
+  *,)   t=`echo "${enableval}" | sed -e "s/,/ /g"`
+        build_warnings="${t} ${build_warnings}";;
+  *)    build_warnings=`echo "${enableval}" | sed -e "s/,/ /g"`;;
+esac
+if test x"$silent" != x"yes" && test x"$build_warnings" != x""; then
+  echo "Setting GDB specific compiler warning flags = $build_warnings" 6>&1
+fi
+fi
+
+# The set of warnings supported by a C++ compiler is not the same as
+# of the C compiler.
+ac_ext=cpp
+ac_cpp='$CXXCPP $CPPFLAGS'
+ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
+
+
+WARN_CFLAGS=""
+if test "x${build_warnings}" != x -a "x$GCC" = xyes
+then
+    { $as_echo "$as_me:${as_lineno-$LINENO}: checking compiler warning flags" >&5
+$as_echo_n "checking compiler warning flags... " >&6; }
+    # Separate out the -Werror flag as some files just cannot be
+    # compiled with it enabled.
+    for w in ${build_warnings}; do
+	# GCC does not complain about -Wno-unknown-warning.  Invert
+	# and test -Wunknown-warning instead.
+	case $w in
+	-Wno-*)
+		wtest=`echo $w | sed 's/-Wno-/-W/g'` ;;
+        -Wformat-nonliteral)
+		# gcc requires -Wformat before -Wformat-nonliteral
+		# will work, so stick them together.
+		w="-Wformat $w"
+		wtest="$w"
+		;;
+	*)
+		wtest=$w ;;
+	esac
+
+	case $w in
+	-Werr*) WERROR_CFLAGS=-Werror ;;
+	*)
+	    # Check whether GCC accepts it.
+	    saved_CFLAGS="$CFLAGS"
+	    CFLAGS="$CFLAGS -Werror $wtest"
+	    saved_CXXFLAGS="$CXXFLAGS"
+	    CXXFLAGS="$CXXFLAGS -Werror $wtest"
+	    if test "x$w" = "x-Wunused-variable"; then
+	      # Check for https://gcc.gnu.org/bugzilla/show_bug.cgi?id=38958,
+	      # fixed in GCC 4.9.  This test is derived from the gdb
+	      # source code that triggered this bug in GCC.
+	      cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+struct scoped_restore_base {};
+                 struct scoped_restore_tmpl : public scoped_restore_base {
+		   ~scoped_restore_tmpl() {}
+		 };
+int
+main ()
+{
+const scoped_restore_base &b = scoped_restore_tmpl();
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_cxx_try_compile "$LINENO"; then :
+  WARN_CFLAGS="${WARN_CFLAGS} $w"
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+	    else
+	      cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+int
+main ()
+{
+
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_cxx_try_compile "$LINENO"; then :
+  WARN_CFLAGS="${WARN_CFLAGS} $w"
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+	    fi
+	    CFLAGS="$saved_CFLAGS"
+	    CXXFLAGS="$saved_CXXFLAGS"
+	esac
+    done
+    { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${WARN_CFLAGS} ${WERROR_CFLAGS}" >&5
+$as_echo "${WARN_CFLAGS} ${WERROR_CFLAGS}" >&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
+
+
+
 TARGET_WORD_SIZE=`sed -n 's,#define BFD_ARCH_SIZE \(.*\)$,\1,p' ../bfd/bfd-in3.h`
 
 cat >>confdefs.h <<_ACEOF
diff --git a/gdbsupport/configure.ac b/gdbsupport/configure.ac
index 6002871c9691..401e16f821da 100644
--- a/gdbsupport/configure.ac
+++ b/gdbsupport/configure.ac
@@ -48,6 +48,9 @@ AM_CONDITIONAL(SELFTEST, $enable_unittests)
 # Check the return and argument types of ptrace.
 GDB_AC_PTRACE
 
+# Detect support warning flags.
+AM_GDB_WARNINGS
+
 TARGET_WORD_SIZE=`sed -n 's,#define BFD_ARCH_SIZE \(.*\)$,\1,p' ../bfd/bfd-in3.h`
 AC_DEFINE_UNQUOTED(TARGET_WORD_SIZE, $TARGET_WORD_SIZE,
    [Define to the word size for the target.])
-- 
2.25.0


^ permalink raw reply	[flat|nested] 9+ messages in thread

* [PATCH 3/3] Add -Wstrict-null-sentinel to gdbsupport/warning.m4
  2020-02-10 16:40 [PATCH 1/3] gdbsupport: use AM_GDB_WARNINGS Simon Marchi
  2020-02-10 16:40 ` [PATCH 2/3] Move gdb/warning.m4 to gdbsupport Simon Marchi
@ 2020-02-10 16:40 ` Simon Marchi
  2020-02-10 16:42   ` Christian Biesinger via gdb-patches
  2020-02-11 14:55 ` [PATCH 1/3] gdbsupport: use AM_GDB_WARNINGS Tom Tromey
  2 siblings, 1 reply; 9+ messages in thread
From: Simon Marchi @ 2020-02-10 16:40 UTC (permalink / raw)
  To: gdb-patches; +Cc: Simon Marchi

Commit 85f0dd3ce ("[gdb] Fix -Wstrict-null-sentinel warnings") fixed
some violations of -Wstrict-null-sentinel.  If we want to enforce this
warning, I think we should enable it in our warning.m4 file.

gdbsupport/ChangeLog:

	* warning.m4: Add -Wstrict-null-sentinel.
	* configure: Re-generate.

gdbserver/ChangeLog:

	* configure: Re-generate.

gdb/ChangeLog:

	* configure: Re-generate.
---
 gdb/configure         | 3 ++-
 gdbserver/configure   | 3 ++-
 gdbsupport/configure  | 3 ++-
 gdbsupport/warning.m4 | 3 ++-
 4 files changed, 8 insertions(+), 4 deletions(-)

diff --git a/gdb/configure b/gdb/configure
index a1d150649729..2ce910c808ce 100755
--- a/gdb/configure
+++ b/gdb/configure
@@ -16111,7 +16111,8 @@ build_warnings="-Wall -Wpointer-arith \
 -Wdeprecated-copy \
 -Wdeprecated-copy-dtor \
 -Wredundant-move \
--Wmissing-declarations"
+-Wmissing-declarations \
+-Wstrict-null-sentinel"
 
 case "${host}" in
   *-*-mingw32*)
diff --git a/gdbserver/configure b/gdbserver/configure
index 4b9d7e3718fa..bd0e667af69b 100755
--- a/gdbserver/configure
+++ b/gdbserver/configure
@@ -9815,7 +9815,8 @@ build_warnings="-Wall -Wpointer-arith \
 -Wdeprecated-copy \
 -Wdeprecated-copy-dtor \
 -Wredundant-move \
--Wmissing-declarations"
+-Wmissing-declarations \
+-Wstrict-null-sentinel"
 
 case "${host}" in
   *-*-mingw32*)
diff --git a/gdbsupport/configure b/gdbsupport/configure
index 197749b5d0ca..1f7d72cc5852 100755
--- a/gdbsupport/configure
+++ b/gdbsupport/configure
@@ -10853,7 +10853,8 @@ build_warnings="-Wall -Wpointer-arith \
 -Wdeprecated-copy \
 -Wdeprecated-copy-dtor \
 -Wredundant-move \
--Wmissing-declarations"
+-Wmissing-declarations \
+-Wstrict-null-sentinel"
 
 case "${host}" in
   *-*-mingw32*)
diff --git a/gdbsupport/warning.m4 b/gdbsupport/warning.m4
index e2b8a43ddbd5..75bc21ca4261 100644
--- a/gdbsupport/warning.m4
+++ b/gdbsupport/warning.m4
@@ -50,7 +50,8 @@ build_warnings="-Wall -Wpointer-arith \
 -Wdeprecated-copy \
 -Wdeprecated-copy-dtor \
 -Wredundant-move \
--Wmissing-declarations"
+-Wmissing-declarations \
+-Wstrict-null-sentinel"
 
 case "${host}" in
   *-*-mingw32*)
-- 
2.25.0


^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH 3/3] Add -Wstrict-null-sentinel to gdbsupport/warning.m4
  2020-02-10 16:40 ` [PATCH 3/3] Add -Wstrict-null-sentinel to gdbsupport/warning.m4 Simon Marchi
@ 2020-02-10 16:42   ` Christian Biesinger via gdb-patches
  2020-02-10 16:46     ` Simon Marchi
  0 siblings, 1 reply; 9+ messages in thread
From: Christian Biesinger via gdb-patches @ 2020-02-10 16:42 UTC (permalink / raw)
  To: Simon Marchi; +Cc: gdb-patches

On Mon, Feb 10, 2020 at 10:40 AM Simon Marchi <simon.marchi@efficios.com> wrote:
>
> Commit 85f0dd3ce ("[gdb] Fix -Wstrict-null-sentinel warnings") fixed
> some violations of -Wstrict-null-sentinel.  If we want to enforce this
> warning, I think we should enable it in our warning.m4 file.
>
> gdbsupport/ChangeLog:
>
>         * warning.m4: Add -Wstrict-null-sentinel.
>         * configure: Re-generate.
>
> gdbserver/ChangeLog:
>
>         * configure: Re-generate.
>
> gdb/ChangeLog:
>
>         * configure: Re-generate.
> ---
>  gdb/configure         | 3 ++-
>  gdbserver/configure   | 3 ++-
>  gdbsupport/configure  | 3 ++-
>  gdbsupport/warning.m4 | 3 ++-
>  4 files changed, 8 insertions(+), 4 deletions(-)
>
> diff --git a/gdb/configure b/gdb/configure
> index a1d150649729..2ce910c808ce 100755
> --- a/gdb/configure
> +++ b/gdb/configure
> @@ -16111,7 +16111,8 @@ build_warnings="-Wall -Wpointer-arith \
>  -Wdeprecated-copy \
>  -Wdeprecated-copy-dtor \
>  -Wredundant-move \
> --Wmissing-declarations"
> +-Wmissing-declarations \
> +-Wstrict-null-sentinel"
>
>  case "${host}" in
>    *-*-mingw32*)
> diff --git a/gdbserver/configure b/gdbserver/configure
> index 4b9d7e3718fa..bd0e667af69b 100755
> --- a/gdbserver/configure
> +++ b/gdbserver/configure
> @@ -9815,7 +9815,8 @@ build_warnings="-Wall -Wpointer-arith \
>  -Wdeprecated-copy \
>  -Wdeprecated-copy-dtor \
>  -Wredundant-move \
> --Wmissing-declarations"
> +-Wmissing-declarations \
> +-Wstrict-null-sentinel"
>
>  case "${host}" in
>    *-*-mingw32*)
> diff --git a/gdbsupport/configure b/gdbsupport/configure
> index 197749b5d0ca..1f7d72cc5852 100755
> --- a/gdbsupport/configure
> +++ b/gdbsupport/configure
> @@ -10853,7 +10853,8 @@ build_warnings="-Wall -Wpointer-arith \
>  -Wdeprecated-copy \
>  -Wdeprecated-copy-dtor \
>  -Wredundant-move \
> --Wmissing-declarations"
> +-Wmissing-declarations \
> +-Wstrict-null-sentinel"
>
>  case "${host}" in
>    *-*-mingw32*)
> diff --git a/gdbsupport/warning.m4 b/gdbsupport/warning.m4
> index e2b8a43ddbd5..75bc21ca4261 100644
> --- a/gdbsupport/warning.m4
> +++ b/gdbsupport/warning.m4
> @@ -50,7 +50,8 @@ build_warnings="-Wall -Wpointer-arith \
>  -Wdeprecated-copy \
>  -Wdeprecated-copy-dtor \
>  -Wredundant-move \
> --Wmissing-declarations"
> +-Wmissing-declarations \
> +-Wstrict-null-sentinel"

Any thoughts on instead dong:
+-Wstrict-null-sentinel \
+"

so that future changes don't need to change the last line? Helps with blame too.

>
>  case "${host}" in
>    *-*-mingw32*)
> --
> 2.25.0
>


^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH 3/3] Add -Wstrict-null-sentinel to gdbsupport/warning.m4
  2020-02-10 16:42   ` Christian Biesinger via gdb-patches
@ 2020-02-10 16:46     ` Simon Marchi
  2020-02-11 14:57       ` Tom Tromey
  0 siblings, 1 reply; 9+ messages in thread
From: Simon Marchi @ 2020-02-10 16:46 UTC (permalink / raw)
  To: Christian Biesinger; +Cc: gdb-patches

On 2020-02-10 11:42 a.m., Christian Biesinger wrote:
> Any thoughts on instead dong:
> +-Wstrict-null-sentinel \
> +"
> 
> so that future changes don't need to change the last line? Helps with blame too.

Sure, I I'll do that.  I like when we use a comma after the last enumerator in enums
too, for the same reason.

Simon


^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH 1/3] gdbsupport: use AM_GDB_WARNINGS
  2020-02-10 16:40 [PATCH 1/3] gdbsupport: use AM_GDB_WARNINGS Simon Marchi
  2020-02-10 16:40 ` [PATCH 2/3] Move gdb/warning.m4 to gdbsupport Simon Marchi
  2020-02-10 16:40 ` [PATCH 3/3] Add -Wstrict-null-sentinel to gdbsupport/warning.m4 Simon Marchi
@ 2020-02-11 14:55 ` Tom Tromey
  2 siblings, 0 replies; 9+ messages in thread
From: Tom Tromey @ 2020-02-11 14:55 UTC (permalink / raw)
  To: Simon Marchi; +Cc: gdb-patches

>>>>> "Simon" == Simon Marchi <simon.marchi@efficios.com> writes:

Simon> Since gdbsupport has been given its own build system, it is no longer
Simon> compiled with the warning flags specified in gdb/warning.m4.

Simon> This patch makes it use AM_GDB_WARNINGS.

Simon> gdbsupport/ChangeLog:

Simon> 	* acinclude.m4: Include ../gdb/warning.m4.
Simon> 	* configure.ac: Use AM_GDB_WARNINGS.
Simon> 	* Makefile.am: Set AM_CFLAGS to WARN_CFLAGS and WERROR_CFLAGS.
Simon> 	* Makefile.in: Re-generate.
Simon> 	* configure: Re-generate.

Thanks, this looks good to me.

Tom


^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH 2/3] Move gdb/warning.m4 to gdbsupport
  2020-02-10 16:40 ` [PATCH 2/3] Move gdb/warning.m4 to gdbsupport Simon Marchi
@ 2020-02-11 14:55   ` Tom Tromey
  0 siblings, 0 replies; 9+ messages in thread
From: Tom Tromey @ 2020-02-11 14:55 UTC (permalink / raw)
  To: Simon Marchi; +Cc: gdb-patches

>>>>> "Simon" == Simon Marchi <simon.marchi@efficios.com> writes:

Simon> This file is used by gdbsupport, gdbserver and gdb, so I think it
Simon> belongs in gdbsupport.  Move it there and update the references the
Simon> various acinclude.m4 files.

Makes sense to me.

Simon> gdbsupport/ChangeLog:

Simon> 	* warning.m4: Move here, from gdb/warning.m4.
Simon> 	* acinclude.m4: Update warning.m4 path.
Simon> 	* Makefile.in: Re-generate.

Simon> gdbserver/ChangeLog:

Simon> 	* acinclude.m4: Update warning.m4 path.

Simon> gdb/ChangeLog:

Simon> 	* acinclude: Update warning.m4 path.
Simon> 	* warning.m4: Move to gdbsupport.

Looks good.

Tom


^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH 3/3] Add -Wstrict-null-sentinel to gdbsupport/warning.m4
  2020-02-10 16:46     ` Simon Marchi
@ 2020-02-11 14:57       ` Tom Tromey
  2020-02-11 16:11         ` Simon Marchi
  0 siblings, 1 reply; 9+ messages in thread
From: Tom Tromey @ 2020-02-11 14:57 UTC (permalink / raw)
  To: Simon Marchi; +Cc: Christian Biesinger, gdb-patches

>>>>> "Simon" == Simon Marchi <simon.marchi@efficios.com> writes:

Simon> On 2020-02-10 11:42 a.m., Christian Biesinger wrote:
>> Any thoughts on instead dong:
>> +-Wstrict-null-sentinel \
>> +"
>> 
>> so that future changes don't need to change the last line? Helps with blame too.

Simon> Sure, I I'll do that.  I like when we use a comma after the last enumerator in enums
Simon> too, for the same reason.

Me too.

Thanks for doing this.  I should have more mail this morning before
writing this same patch :-)

This looks good, please check it all in.

Tom


^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH 3/3] Add -Wstrict-null-sentinel to gdbsupport/warning.m4
  2020-02-11 14:57       ` Tom Tromey
@ 2020-02-11 16:11         ` Simon Marchi
  0 siblings, 0 replies; 9+ messages in thread
From: Simon Marchi @ 2020-02-11 16:11 UTC (permalink / raw)
  To: Tom Tromey, Simon Marchi; +Cc: Christian Biesinger, gdb-patches

On 2020-02-11 9:56 a.m., Tom Tromey wrote:
>>>>>> "Simon" == Simon Marchi <simon.marchi@efficios.com> writes:
> 
> Simon> On 2020-02-10 11:42 a.m., Christian Biesinger wrote:
>>> Any thoughts on instead dong:
>>> +-Wstrict-null-sentinel \
>>> +"
>>>
>>> so that future changes don't need to change the last line? Helps with blame too.
> 
> Simon> Sure, I I'll do that.  I like when we use a comma after the last enumerator in enums
> Simon> too, for the same reason.
> 
> Me too.
> 
> Thanks for doing this.  I should have more mail this morning before
> writing this same patch :-)
> 
> This looks good, please check it all in.
> 
> Tom
> 

Thanks, I pushed the series.

Simon


^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2020-02-11 16:11 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-02-10 16:40 [PATCH 1/3] gdbsupport: use AM_GDB_WARNINGS Simon Marchi
2020-02-10 16:40 ` [PATCH 2/3] Move gdb/warning.m4 to gdbsupport Simon Marchi
2020-02-11 14:55   ` Tom Tromey
2020-02-10 16:40 ` [PATCH 3/3] Add -Wstrict-null-sentinel to gdbsupport/warning.m4 Simon Marchi
2020-02-10 16:42   ` Christian Biesinger via gdb-patches
2020-02-10 16:46     ` Simon Marchi
2020-02-11 14:57       ` Tom Tromey
2020-02-11 16:11         ` Simon Marchi
2020-02-11 14:55 ` [PATCH 1/3] gdbsupport: use AM_GDB_WARNINGS Tom Tromey

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox