[3/3] Add -Wstrict-null-sentinel to gdbsupport/warning.m4

Message ID 20200210164024.32445-3-simon.marchi@efficios.com
State New
Headers show
Series
  • [1/3] gdbsupport: use AM_GDB_WARNINGS
Related show

Commit Message

Simon Marchi Feb. 10, 2020, 4:40 p.m.
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(-)

-- 
2.25.0

Comments

Pedro Alves via Gdb-patches Feb. 10, 2020, 4:42 p.m. | #1
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

>
Simon Marchi Feb. 10, 2020, 4:46 p.m. | #2
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
Tom Tromey Feb. 11, 2020, 2:56 p.m. | #3
>>>>> "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
Simon Marchi Feb. 11, 2020, 4:11 p.m. | #4
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

Patch

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*)