From 6d12ab3f897310354bbaffd7a07b0458f489a7df Mon Sep 17 00:00:00 2001 From: Brad King Date: Sat, 12 Nov 2011 09:39:40 -0500 Subject: [PATCH] KWIML: Suppress printf/scanf format warnings in test KWIML defines format string macros matching the fixed-sized types. This test checks that they behave as expected and that the arguments match the *sizes* expected by the format strings. --- test/CMakeLists.txt | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt index aaff9e934..15816cf6f 100644 --- a/test/CMakeLists.txt +++ b/test/CMakeLists.txt @@ -18,6 +18,13 @@ set_property(DIRECTORY "KWIML_HEADER(%)=<${KWIML}/%>" ) +# Suppress printf/scanf format warnings; we test if the sizes match. +foreach(lang C CXX) + if(KWIML_LANGUAGE_${lang} AND "${CMAKE_${lang}_COMPILER_ID}" STREQUAL GNU) + set(CMAKE_${lang}_FLAGS "${CMAKE_${lang}_FLAGS} -Wno-format") + endif() +endforeach() + if(KWIML_LANGUAGE_C) set(test_srcs test.c) else()