make: Clean up WERROR handling #9357
Merged
cladmi merged 1 commit intoRIOT-OS:masterfrom Jun 26, 2018
Merged
Conversation
This was referenced Jun 14, 2018
cladmi
reviewed
Jun 15, 2018
Contributor
cladmi
left a comment
There was a problem hiding this comment.
I globally agree, now that -Wextra can be set by default without warnings to always enable it.
As the same time for cleaning, I think -pedantic-errors can be removed as explained inline.
Makefile.include
Outdated
| CFLAGS += -Wpedantic -pedantic-errors | ||
| CFLAGS += -Wpedantic | ||
| ifeq ($(WERROR),1) | ||
| CFLAGS += -pedantic-errors |
Contributor
There was a problem hiding this comment.
From some testing, -pedantic-errors looks redundant with -Werror -Wpedantic and so could be removed.
I get the same behavior with and without -pedantic-errors for the following:
Compiling unittests for samr21-xpro with
make -C tests/unittests/ tests-spiffs BOARD=samr21-xpro WPEDANTIC=1 WERROR=0
and with WERROR=1.
While having the following diff to have a warning:
diff --git a/pkg/spiffs/Makefile.spiffs b/pkg/spiffs/Makefile.spiffs
index 1cb6ab8..bd7256c 100644
--- a/pkg/spiffs/Makefile.spiffs
+++ b/pkg/spiffs/Makefile.spiffs
@@ -1,6 +1,6 @@
MODULE := spiffs
# Disable 'ISO C99 doesn’t support unnamed structs/unions [-Werror=pedantic]'
-CFLAGS += -Wno-pedantic
+#CFLAGS += -Wno-pedantic
include $(RIOTBASE)/Makefile.base
cladmi
approved these changes
Jun 18, 2018
Contributor
cladmi
left a comment
There was a problem hiding this comment.
ACK, I tested the four possibilities of WERROR and WPEDANTIC by playing with spiffs pedantic configuration.
Please squash.
Member
Author
|
squashed |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Contribution description
Clean up of the WERROR handling in Makefile.include to let the WERROR variable only control the actual -Werror compiler flag. All other warning related flags are set regardless of WERROR=1 or not.
Issues/PRs references