From: Julian Ospald Date: Wed Dec 5 14:12:08 UTC 2012 Subject: document handling of -Werror set by build systems wrt #415979 --- ebuild-writing/common-mistakes/text.xml +++ ebuild-writing/common-mistakes/text.xml @@ -94,6 +94,56 @@ +-Werror compiler flag not removed + +"-Werror" is a flag which turns all warnings into errors and thus will abort compiling if any warning is encountered. + +

Rationale

+This flag is not recommended for releases and should always be disabled when encountered in build-logs, because there are numerous cases where this breaks without purpose, e.g.: +

+Turning off "-Werror" we will still see the warnings, but there is no reason that they cause compile failure. Also note that portage already emits QA notices about gcc warnings that can cause runtime breakage. +

+ +

How to fix

+To fix the affected build system you should try the following methods: +

+Always check that it's really gone in the build log. +

+ +

Specific -Werror=... flags

+GCC can turn any specific warning into an error. A specific -Werror flag would be "-Werror=implicit-function-declaration" for example and will only affect warnings about implicit function declarations. It's mostly safe to leave these untouched, cause they are pinned to this issue and should not cause random build time breakage. Also, we can expect that upstream did this on purpose to avoid known runtime errors and not just for testing their builds. However you should check the specified warnings yourself or ask other developers if unsure. +

+ +

Exceptions

+Removing "-Werror" from configure.ac can cause breakage in very rare cases where the configure phase relies on the exit code. See app-emulation/open-vm-tools bug. But even then we remove it from the resulting Makefile. +

+ +
+ + Missing/Invalid/Broken Header