Skip to content

Commit 25a332d

Browse files
committed
Updates to GCC warning level flags
In gcc4mbed, I have been running with "-Wall -Wextra" and then disabling a couple of noisy warnings that result. In particular, I disable the unused-parameter and missing-field-initializers warnings. The first commonly goes off for implementation of virtual methods or other overridable functions where not all parameters are required for every override. I don't find the second warning to be all that useful anyway since missing structure field initializers will be set to 0 according to the C language specification. The RTOS code uses this language feature and I see no reason that it shouldn't :)
1 parent 32fa9b2 commit 25a332d

File tree

1 file changed

+2
-1
lines changed
  • workspace_tools/toolchains

1 file changed

+2
-1
lines changed

workspace_tools/toolchains/gcc.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,8 @@ def __init__(self, target, options=None, notify=None, tool_path=""):
4747

4848
# Note: We are using "-O2" instead of "-Os" to avoid this known GCC bug:
4949
# http://gcc.gnu.org/bugzilla/show_bug.cgi?id=46762
50-
common_flags = ["-c", "-O2", "-Wall",
50+
common_flags = ["-c", "-O2", "-Wall", "-Wextra",
51+
"-Wno-unused-parameter", "-Wno-missing-field-initializers",
5152
"-fmessage-length=0", "-fno-exceptions", "-fno-builtin",
5253
"-ffunction-sections", "-fdata-sections",
5354
"-MMD", "-fno-delete-null-pointer-checks",

0 commit comments

Comments
 (0)