[PATCH] ada-lex.l: Ignore register diagnostic also for g++ defaulting to ISO C++17

Mark Wielaard mark@klomp.org
Sat Aug 22 18:15:24 GMT 2020


Hi,

On Sat, 2020-08-22 at 10:41 -0400, Simon Marchi wrote:
> This breaks when building with an old gcc, for example 4.8 (which,
> last time I checked, still wanted to support):
> 
>   CXX    ada-exp.o
> In file included from /home/smarchi/src/binutils-gdb/gdb/ada-
> exp.y:726:0:
> /home/smarchi/src/binutils-gdb/gdb/ada-lex.l:52:24: error: unknown
> option after ‘#pragma GCC diagnostic’ kind [-Werror=pragmas]
>  DIAGNOSTIC_IGNORE_DEPRECATED_REGISTER
>                         ^
> 
> I think you'll have to check which gcc version introduced that
> warning and make a conditional based on it.

It was introduced in GCC 7. How about the attached? Also s/modern
g++/g++ 11/ to be more specific about the version, as Pedro hinted at.

Tested against gcc 4.8.5 and 11.0.0.

Cheers,

Mark
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-ada-lex.l-Ignore-register-diagnostic-also-for-g-defa.patch
Type: text/x-patch
Size: 2551 bytes
Desc: 
URL: <https://sourceware.org/pipermail/gdb-patches/attachments/20200822/76d87610/attachment-0001.bin>


More information about the Gdb-patches mailing list