[cfe-dev] RFC: default to -Werror=format-security

Nico Weber via cfe-dev cfe-dev at lists.llvm.org
Tue Feb 16 12:44:00 PST 2016


On Tue, Feb 16, 2016 at 12:22 PM, Craig, Ben <ben.craig at codeaurora.org>
wrote:

>
> On 2/16/2016 1:18 PM, Nico Weber via cfe-dev wrote:
>
>>
>> Won't this line of reasoning lead to all useful warnings being in -Werror
>> eventually? Say, forgetting a return statement in a function is also "just"
>> a warning...
>>
>
> Not all of them :)
>
> Visual Studio groups warnings into big warning level buckets.  Level 1 has
> the most important / severe (obvious use of uninitialized value), level 4
> has fairly minor warnings (unused parameter), and /Weverything will tell
> you about really useless stuff (warning! you just used __declspec(align)!
> ).  I could imagine a world where the "Level 1", and maybe "Level 2"
> warnings were errors by default.
>

We have this too: on-by-default warnings, -Wall, -Wextra, -Weverything. I
don't think we should turn on-by-default warnings into errors.


>
> We should make it harder to compile broken code, and easier to write
> correct code.  We can't change it all at once without angering the world
> though :)


People who don't like writing broken code don't ignore warnings. People who
do like writing broken code will just pass -Wno-error. I don't think this
proposal helps either party.


>
>
> --
> Employee of Qualcomm Innovation Center, Inc.
> Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum, a Linux
> Foundation Collaborative Project
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20160216/6092bc38/attachment.html>


More information about the cfe-dev mailing list