From 31860044120ded54565ef7b0b307130d61f0fd9a Mon Sep 17 00:00:00 2001 From: xpol Date: Mon, 30 Jul 2012 19:12:01 +0800 Subject: [PATCH 1/2] Support 'NoWarnings' flags for gcc. --- src/tools/gcc.lua | 2 ++ tests/tools/test_gcc.lua | 10 ++++++++++ 2 files changed, 12 insertions(+) diff --git a/src/tools/gcc.lua b/src/tools/gcc.lua index aae34ee6..9f26adf2 100644 --- a/src/tools/gcc.lua +++ b/src/tools/gcc.lua @@ -94,6 +94,7 @@ EnableSSE2 = "-msse2", ExtraWarnings = "-Wall -Wextra", FatalWarnings = "-Werror", + NoWarnings = "-w", FloatFast = "-ffast-math", FloatStrict = "-ffloat-store", NoFramePointer = "-fomit-frame-pointer", @@ -272,6 +273,7 @@ EnableSSE2 = "-msse2", ExtraWarnings = "-Wall", FatalWarnings = "-Werror", + NoWarnings = "-w", FloatFast = "-ffast-math", FloatStrict = "-ffloat-store", NoFramePointer = "-fomit-frame-pointer", diff --git a/tests/tools/test_gcc.lua b/tests/tools/test_gcc.lua index 62e503f1..2f97c210 100644 --- a/tests/tools/test_gcc.lua +++ b/tests/tools/test_gcc.lua @@ -65,7 +65,17 @@ test.isequal({ "-Werror" }, gcc.getcflags(cfg)) end + function suite.cflags_onExtraWarnings() + flags { "ExtraWarnings" } + prepare() + test.isequal({ "-Wall -Wextra" }, gcc.getcflags(cfg)) + end + function suite.cflags_onExtraWarnings() + flags { "NoWarnings" } + prepare() + test.isequal({ "-w" }, gcc.getcflags(cfg)) + end -- -- Check the translation of CXXFLAGS. -- From 46fe87e6e32994f3554651d1ea1a7dd8bd50e64e Mon Sep 17 00:00:00 2001 From: xpol Date: Mon, 30 Jul 2012 20:52:35 +0800 Subject: [PATCH 2/2] fix the duplicated test name. --- tests/tools/test_gcc.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/tools/test_gcc.lua b/tests/tools/test_gcc.lua index 2f97c210..9b779550 100644 --- a/tests/tools/test_gcc.lua +++ b/tests/tools/test_gcc.lua @@ -71,7 +71,7 @@ test.isequal({ "-Wall -Wextra" }, gcc.getcflags(cfg)) end - function suite.cflags_onExtraWarnings() + function suite.cflags_onNoWarnings() flags { "NoWarnings" } prepare() test.isequal({ "-w" }, gcc.getcflags(cfg))