]> git.ipfire.org Git - thirdparty/vectorscan.git/commitdiff
Don't ignore unused attrib warnings in test
authorMatthew Barr <matthew.barr@intel.com>
Mon, 12 Dec 2016 03:52:06 +0000 (14:52 +1100)
committerMatthew Barr <matthew.barr@intel.com>
Wed, 14 Dec 2016 04:35:28 +0000 (15:35 +1100)
cmake/attrib.cmake

index 6ce3f2a73c6a20bf435380bafd2d57dd3a16ed75..5600ce6b7cbc37e1fd85272ebc3872cefc4c5e38 100644 (file)
@@ -1,3 +1,13 @@
 # tests for compiler properties
 
-CHECK_C_SOURCE_COMPILES("int foo(int) __attribute__ ((ifunc(\"foo_i\"))); int f1(int i) { return i; } void (*foo_i()) { return f1; } int main(void) { return 0; }" HAS_C_ATTR_IFUNC)
+# set -Werror so we can't ignore unused attribute warnings
+set (CMAKE_REQUIRED_FLAGS "-Werror")
+
+CHECK_C_SOURCE_COMPILES("
+    int foo(int) __attribute__ ((ifunc(\"foo_i\")));
+    int f1(int i) { return i; }
+    void (*foo_i()) { return f1; }
+    int main(void) { return 0; }
+    " HAS_C_ATTR_IFUNC)
+
+unset(CMAKE_REQUIRED_FLAGS)