[cfe-dev] [RFC] Handling implementation limits

Keane, Erich via cfe-dev cfe-dev at lists.llvm.org
Mon Jan 6 12:53:23 PST 2020


It IS -Wpedantic (after talking to you directly, ansi was forcing not C99 mode), but it isn’t included in there explicitly.  There is logic in clang tablegen that puts a diagnostic in pedantic based on some rules (including off-by-default, isExtension, etc).

From: cfe-dev <cfe-dev-bounces at lists.llvm.org> On Behalf Of Craig Topper via cfe-dev
Sent: Monday, January 6, 2020 12:49 PM
To: Eli Friedman <efriedma at quicinc.com>
Cc: cfe-dev at lists.llvm.org
Subject: Re: [cfe-dev] [RFC] Handling implementation limits

Maybe its -ansi and not -Wpedantic. I admit I didn't check exactly. It just knew there was some warning.

~Craig


On Mon, Jan 6, 2020 at 11:50 AM Eli Friedman <efriedma at quicinc.com<mailto:efriedma at quicinc.com>> wrote:
> -----Original Message-----
> From: cfe-dev <cfe-dev-bounces at lists.llvm.org<mailto:cfe-dev-bounces at lists.llvm.org>> On Behalf Of Mark de Wever
> via cfe-dev
> Sent: Sunday, January 5, 2020 7:42 AM
> To: Craig Topper <craig.topper at gmail.com<mailto:craig.topper at gmail.com>>
> Cc: cfe-dev at lists.llvm.org<mailto:cfe-dev at lists.llvm.org>
> Subject: [EXT] Re: [cfe-dev] [RFC] Handling implementation limits
>
> On Sat, Jan 04, 2020 at 01:52:55PM -0800, Craig Topper wrote:
> > Do you plan to also support things that aren’t implementation limits but
> > give warnings under -Wpedantic? For example the length of a string literal
> > in LiteralSupport.cpp. It checks for something like 509 for C, 4095 for C99
> > or 65536 for C++.
>
> These are part of the limits of the standards, else they can be added to
> the Non standard limits.

I'm not sure why we're generating warnings under -Wpedantic in this case, actually.  Neither C nor C++ actually forbids string literals longer than the limit; they just don't require implementations to accept them.  -Wpedantic is not supposed to contain portability warnings.

-Eli
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20200106/4ed9b10f/attachment.html>


More information about the cfe-dev mailing list