[PATCH] ada-lex.l: Ignore register diagnostic also for g++ defaulting to ISO C++17
Simon Marchi
simark@simark.ca
Sat Aug 22 19:01:59 GMT 2020
On 2020-08-22 2:15 p.m., Mark Wielaard wrote:
> 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
>
Thanks, this one LGTM :).
Simon
More information about the Gdb-patches
mailing list