ojhunt wrote:

> Can we just drop the check from `__has_extension` handling?
> 
> It looks like that check dates back to the introduction of __has_extension 
> ([d5d410f](https://github.com/llvm/llvm-project/commit/d5d410faa8cfbbf4e2ffc2f8aa470491a77fd843)).
>  But it's a terrible idea for a lot of reasons: it adds a semantic effect to 
> a flag which otherwise doesn't have any semantic effects, and even for 
> extensions that _are_ actually extensions, there are plenty of ways to 
> suppress the diagnostic even in `pedantic-errors` mode.
> 
> (And as a practical matter, some large fraction of codebases that care about 
> pedantic warnings probably use `-Werror -pedantic`, which doesn't have this 
> effect, so it's not like we were even being consistent here.)

Yeah, that's what I was thinking -- it honestly feels like an optimization that 
may have been inherited from gcc if that came first, but the optimization is 
based on an assumption that all use of any extensions will produce a warning 
that gets promoted to an error which is not accurate.

I would be concerned about changing this specific behavior for llvm21 though, 
but I have an idea for a more targeted change

https://github.com/llvm/llvm-project/pull/153291
_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to