build.sh: Don't use -Werror as default.#9420
Conversation
While being a good practice to use during development, enabling -Werror by default for deployment and user builds is a guarantee for failed builds. It is not feasible for development to keep up with all warnings in all compiler versions, especially ones from the future. To avoid the build being broken, this patch sets -Werror being disabled as default behavior. This mimics the behavior of CMake being invoked directly without the build.sh script. While a zero warning policy is good, and -Werror should also be enabled by default on the CI, it is a bad practice for deployment. https://embeddedartistry.com/blog/2017/05/22/werror-is-not-your-friend/
|
lubosz - is not a collaborator |
|
@lubosz build.sh is for development, developers are required to build with errors as warning. While porting to new compilers, developers can disable |
|
@stsoe Thank you for your response. This is just a recommendation for the reasons listed above.
According to the documentation, This means that everyone following this documentation, may it be developer, distributor or advanced user, will face It's just a frustrating experience for on-boarding new developers. In the end this MR is just to stimulate thoughts, I did not expect it to be merged. Maybe pointing the fact that I did my duty and started my contribution history to this project by fixing a warning that was treated as error, a review would be very appreciated: |
While being a good practice to use during development, enabling
-Werrorby default for deployment and user builds is a guarantee for failed builds.It is not feasible for development to keep up with all warnings in all compiler versions, especially ones from the future.
To avoid the build being broken, this patch sets
-Werrorbeing disabled as default behavior. This mimics the behavior of CMake being invoked directly without the build.sh script.While a zero warning policy is good, and
-Werrorshould also be enabled by default on the CI, it is a bad practice for deployment.https://embeddedartistry.com/blog/2017/05/22/werror-is-not-your-friend/
Problem solved by the commit
Project fails building on newer compiler versions.
Bug / issue (if any) fixed, which PR introduced the bug, how it was discovered
How problem was solved, alternative solutions (if any) and why they were rejected
Providing a saner default.
Risks (if any) associated the changes in the commit
The project will more likely build on newer compiler versions.
What has been tested and how, request additional testing if necessary
Documentation impact (if any)