Live data from Hacker News

Don't use -Werror

blog.schmorp.de

1–10 of 74 posts

Re: Don't use -Werror

#2
Summary:

Enable -Werror in debug builds, disable it in production builds (in publicly released builds).

Reason: -Werror is helpful for you, useless for a 3rd party.

Re: Don't use -Werror

#7
I see the issue as: there are warnings and warnings

One thing is for the compiler to warn about something like implicit conversion of one type to another.

Another, very different, if warning for things that are correct but might be in error (like 'for' without brackets, etc)

Re: Don't use -Werror

#8
I use -W4 and -WX with MSVC to enable the highest warning level and flag all warnings as errors. Then I disable a couple of the more pointless warnings (unreferenced formal parameter, unreferenced local function, unreachable code...) that would otherwise keep me from being able to use -W4 without jumping through arbitrary hoops.

The problem with GCC, at least at the time I was using it several years ago, is that there seemed to be no way to disable individual warnings. Is that still true (or was it ever?)

Re: Don't use -Werror

#9

I use -W4 and -WX with MSVC to enable the highest warning level and flag all warnings as errors. Then I disable a couple of the more pointless warnings (unreferenced formal parameter, unreferenced local function, unreachable code...) that would otherwise keep me from being able to use -W4 without jumping through arbitrary hoops. The problem with GCC, at least at the time I was using it several years ago, is that ther…

-Wno-specific-warning (I think it's always had this, or at least for a very long time).

Re: Don't use -Werror

#10
post #2

Summary: Enable -Werror in debug builds, disable it in production builds (in publicly released builds). Reason: -Werror is helpful for you, useless for a 3rd party.

Came here to say exactly this. No reason you can't be extra careful during development and turn the flags off in release configuration.
Post reply on HN