Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

"Werror is a guarantueed build break whenever the build is tried on a system the original developer had no access to."

Yeah, if your program uses undefined behaviour or your cc is crazy. I think the point is to catch undefined behaviour and make sure it isn't ignored.



gcc routinely introduced new warnings that break correctly working software's build if they use -Werror. For example, Gentoo had a lot of problems with this in the past, as do other packagers, it's just that Gentoo users are more exposed to build failures (upgrade gcc, rebuild tree, watch the fun).


I still don't see the problem, warnings usually indicate problems with the code, even if that particular sort of warning was added in a new version of the cc. If they don't indicate actual problems then the compiler is broken, but I still don't think that's a problem since they can usually be silenced in some non-intrusive way. Also you shouldn't be trying to build software if you don't know how to report a bug or have a buggy toolchain (so maybe a lot of Gentoo users shouldn't be using Gentoo).


Compiler warnings can come down to things that are purely style, like unused variables. It's more than likely that an unused variable could sneak itself into a program, not be found for a few years, then suddenly trigger a warning when a compiler added the check (of course, compilers have been checking for this for a long time, but this is just an example).

In the case of Gentoo, this would manifest itself as packages compiling cleanly with one compiler version, then suddenly lots of packages failing to compile because the build processes were stopped due to the, now reported, unused variable. If these were just warnings, then the packages would still compile, someone would notice (or even the original dev), and the problem can be fixed. Note that before the compiler upgrade, there was no bug - the program worked fine.

Except for a case such as libressl (preview release so they can get comments), having -Werror hardcoded in the build process clearly makes no sense.


Sorry, I still don't believe that's a problem. Unused variable warnings can be silenced easily if they aren't real bugs (for example an unused parameter in a callback). Most people don't have to deal with this stuff because they use precompiled binaries. The people that do deal with this should know how to fix it properly.


It's already necessary far too much of the time to manually back and slash C code to get it to build in an untested or newer environment, without adding additional cases over purely stylistic compiler complaints. Precompiled binaries aren't available for every system for which one might want to use portable software.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: