[cfe-dev] [libc++abi] [PATCH] silencing -Wundef warnings

Florian Kutscherauer florian.kutscherauer at gmx.at
Tue Oct 29 04:30:38 PDT 2013


Nick Kledzik wrote:
> -#if __arm__
> +#if defined(__arm__)
>
> The above is a semantic change.  If someone set -D__arm__=0, the
> changed code does something different.

Thank you for catching that!  I didn't even dare to think that someone
might intentionally set a symbol that is meant to be built-in.

BTW: do you know of a way to ask clang to issue a warning if somebody
would do such a horrible thing?

> IANALL, but -Wundef triggering on these built-in preprocessor symbols
> seems wrong.

I think this behavior is perfectly reasonable.  After all, these are
"just" preprocessor symbols like all others, so the user should check
them in the same way.

What I would really like, though, would be for clang to check if someone
were to mess with symbols that are meant to be built-in (e.g. by re- or
undefining  them).  That could really mess things up!

> Florian Kutscherauer wrote:
>> [...] None of the functionality has changed[...].
>>
>> *fingers crossed*

Apparently that didn't do the trick...

>> [...]  I will keep working [... u]nless someone wants me to "keep
>> my filthy hands off" their code, that is.  ;-)

Best regards, Flo.



More information about the cfe-dev mailing list