Add -Wno-error=deprecated-register to gdb build flags

Message ID 20180401180931.16643-1-simon.marchi@polymtl.ca
State New
Headers show
Series
  • Add -Wno-error=deprecated-register to gdb build flags
Related show

Commit Message

Simon Marchi April 1, 2018, 6:09 p.m.
As shown in PR 23022, building with clang-6 and Python 2 trips on the
fact that the Python 2 headers use the "register" keyword:

/usr/include/python2.7/unicodeobject.h:534:5: error: 'register' storage class specifier is deprecated and incompatible with C++17 [-Werror,-Wdeprecated-register]
    register PyObject *obj,     /* Object */
    ^~~~~~~~~

This patch adds -Wno-error=deprecated-register to our flags, so that we can
still see this class of warnings, but they don't cause a build failure.

gdb/ChangeLog:

	PR gdb/23022
	* warning.m4: Add -Wno-error=deprecated-register.
	* configure: Re-generate.
---
 gdb/configure  | 3 ++-
 gdb/warning.m4 | 3 ++-
 2 files changed, 4 insertions(+), 2 deletions(-)

-- 
2.16.3

Comments

Simon Marchi April 6, 2018, 8:16 p.m. | #1
On 2018-04-01 14:09, Simon Marchi wrote:
> As shown in PR 23022, building with clang-6 and Python 2 trips on the

> fact that the Python 2 headers use the "register" keyword:

> 

> /usr/include/python2.7/unicodeobject.h:534:5: error: 'register'

> storage class specifier is deprecated and incompatible with C++17

> [-Werror,-Wdeprecated-register]

>     register PyObject *obj,     /* Object */

>     ^~~~~~~~~

> 

> This patch adds -Wno-error=deprecated-register to our flags, so that we 

> can

> still see this class of warnings, but they don't cause a build failure.

> 

> gdb/ChangeLog:

> 

> 	PR gdb/23022

> 	* warning.m4: Add -Wno-error=deprecated-register.

> 	* configure: Re-generate.

> ---

>  gdb/configure  | 3 ++-

>  gdb/warning.m4 | 3 ++-

>  2 files changed, 4 insertions(+), 2 deletions(-)

> 

> diff --git a/gdb/configure b/gdb/configure

> index ab5818785333..f2acc1bf9e2c 100755

> --- a/gdb/configure

> +++ b/gdb/configure

> @@ -15358,7 +15358,8 @@ build_warnings="-Wall -Wpointer-arith \

>  -Wno-switch -Wno-char-subscripts \

>  -Wempty-body -Wunused-but-set-parameter -Wunused-but-set-variable \

>  -Wno-sign-compare -Wno-narrowing -Wno-error=maybe-uninitialized \

> --Wno-mismatched-tags"

> +-Wno-mismatched-tags \

> +-Wno-error=deprecated-register"

> 

>  case "${host}" in

>    *-*-mingw32*)

> diff --git a/gdb/warning.m4 b/gdb/warning.m4

> index ba52fb6c9ff0..3cfae65e7808 100644

> --- a/gdb/warning.m4

> +++ b/gdb/warning.m4

> @@ -41,7 +41,8 @@ build_warnings="-Wall -Wpointer-arith \

>  -Wno-switch -Wno-char-subscripts \

>  -Wempty-body -Wunused-but-set-parameter -Wunused-but-set-variable \

>  -Wno-sign-compare -Wno-narrowing -Wno-error=maybe-uninitialized \

> --Wno-mismatched-tags"

> +-Wno-mismatched-tags \

> +-Wno-error=deprecated-register"

> 

>  case "${host}" in

>    *-*-mingw32*)


I tripped on this again today, so I pushed this patch.

Simon

Patch

diff --git a/gdb/configure b/gdb/configure
index ab5818785333..f2acc1bf9e2c 100755
--- a/gdb/configure
+++ b/gdb/configure
@@ -15358,7 +15358,8 @@  build_warnings="-Wall -Wpointer-arith \
 -Wno-switch -Wno-char-subscripts \
 -Wempty-body -Wunused-but-set-parameter -Wunused-but-set-variable \
 -Wno-sign-compare -Wno-narrowing -Wno-error=maybe-uninitialized \
--Wno-mismatched-tags"
+-Wno-mismatched-tags \
+-Wno-error=deprecated-register"
 
 case "${host}" in
   *-*-mingw32*)
diff --git a/gdb/warning.m4 b/gdb/warning.m4
index ba52fb6c9ff0..3cfae65e7808 100644
--- a/gdb/warning.m4
+++ b/gdb/warning.m4
@@ -41,7 +41,8 @@  build_warnings="-Wall -Wpointer-arith \
 -Wno-switch -Wno-char-subscripts \
 -Wempty-body -Wunused-but-set-parameter -Wunused-but-set-variable \
 -Wno-sign-compare -Wno-narrowing -Wno-error=maybe-uninitialized \
--Wno-mismatched-tags"
+-Wno-mismatched-tags \
+-Wno-error=deprecated-register"
 
 case "${host}" in
   *-*-mingw32*)