From 25a332d8f1627af4100d81f22ed438526027a1b5 Mon Sep 17 00:00:00 2001 From: Adam Green Date: Thu, 22 Aug 2013 17:45:45 -0700 Subject: [PATCH] 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 :) --- workspace_tools/toolchains/gcc.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/workspace_tools/toolchains/gcc.py b/workspace_tools/toolchains/gcc.py index c4e8f5c771..e864c7a7a3 100644 --- a/workspace_tools/toolchains/gcc.py +++ b/workspace_tools/toolchains/gcc.py @@ -47,7 +47,8 @@ class GCC(mbedToolchain): # Note: We are using "-O2" instead of "-Os" to avoid this known GCC bug: # http://gcc.gnu.org/bugzilla/show_bug.cgi?id=46762 - common_flags = ["-c", "-O2", "-Wall", + common_flags = ["-c", "-O2", "-Wall", "-Wextra", + "-Wno-unused-parameter", "-Wno-missing-field-initializers", "-fmessage-length=0", "-fno-exceptions", "-fno-builtin", "-ffunction-sections", "-fdata-sections", "-MMD", "-fno-delete-null-pointer-checks",