yet another strange message from LLVM/Clang on FreeBSD 13 i686

Hans Åberg haberg-1 at telia.com
Mon Aug 24 08:41:46 UTC 2020


> On 24 Aug 2020, at 05:08, Vincent Lefevre <vincent at vinc17.net> wrote:
> 
> On 2020-08-23 23:06:35 +0200, Torbjorn Granlund wrote:
>> Dennis Clarke <dclarke at blastwave.org> writes:
>> 
>>  tset_si.c:262:9: error: keyword is hidden by macro definition
>> 
>> There is no file with that name in GMP.  Perhaps you should report this
>> issue to MPFR?
> 
> Anyway, this is a bug in the compiler. Redefining a keyword by a macro
> is not disallowed by the C standard, and this is the purpose of this
> test that such a redefinition does not affect MPFR.

Clang has a pedagogical approach, intended to make it easy for newbies which have not bothered learning C/C++, and breaks the rule to not issue diagnostics for perfectly legal code unless called for. To avoid such diagnostics, I have added lines like
#pragma clang diagnostic ignored "-Wlogical-op-parentheses"
#pragma clang diagnostic ignored "-Wdangling-else"

For your case, you might add
#pragma clang diagnostic ignored "-Wkeyword-macro"

See
https://clang.llvm.org/docs/DiagnosticsReference.html#id406




More information about the gmp-discuss mailing list