From 3d0266b66446dd1cd0a9d843dd8cd20954e9b980 Mon Sep 17 00:00:00 2001 From: Michael Kruse Date: Thu, 20 Oct 2016 11:16:19 +0000 Subject: [PATCH] [cmake] Avoid warnings in feature tests. NFC. Apply the __attribute__((unused)) before the function to unambiguously apply to the function declaration. Add more casts-to-void to mark return values unused as intended. Contributed-by: Andy Gibbs llvm-svn: 284718 --- polly/lib/External/CMakeLists.txt | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/polly/lib/External/CMakeLists.txt b/polly/lib/External/CMakeLists.txt index 7471cef..eafb6be 100644 --- a/polly/lib/External/CMakeLists.txt +++ b/polly/lib/External/CMakeLists.txt @@ -65,7 +65,7 @@ if (HAS_ATTRIBUTE_WARN_UNUSED_RESULT) endif () check_c_source_compiles(" - static void foo(void) __attribute__ ((unused)); + __attribute__ ((unused)) static void foo(void); int main() { return 0; } " HAVE___ATTRIBUTE__) @@ -76,12 +76,12 @@ check_c_source_compiles_numeric(" " HAVE_DECL_FFS) check_c_source_compiles_numeric(" - int main() { __builtin_ffs(0); return 0; } + int main() { (void)__builtin_ffs(0); return 0; } " HAVE_DECL___BUILTIN_FFS) check_c_source_compiles_numeric(" #include - int main() { _BitScanForward(NULL, 0); return 0; } + int main() { (void)_BitScanForward(NULL, 0); return 0; } " HAVE_DECL__BITSCANFORWARD) if (NOT HAVE_DECL_FFS AND @@ -98,7 +98,7 @@ check_c_source_compiles_numeric(" check_c_source_compiles_numeric(" #include - int main() { _stricmp(\"\", \"\"); return 0; } + int main() { (void)_stricmp(\"\", \"\"); return 0; } " HAVE_DECL__STRICMP) if (NOT HAVE_DECL_STRCASECMP AND NOT HAVE_DECL__STRICMP) @@ -113,7 +113,7 @@ check_c_source_compiles_numeric(" check_c_source_compiles_numeric(" #include - int main() { _strnicmp(\"\", \"\", 0); return 0; } + int main() { (void)_strnicmp(\"\", \"\", 0); return 0; } " HAVE_DECL__STRNICMP) if (NOT HAVE_DECL_STRNCASECMP AND NOT HAVE_DECL__STRNICMP) -- 2.7.4