From 33419c8dd1fa73c132b3fb87537bcb994c61cda8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Attila=20Ol=C3=A1h?= Date: Sat, 12 Jun 2021 12:56:51 +0200 Subject: [PATCH] Fix compilation with -Wunused-variable When compiling with -Wunused-variable, `EXT_STRERROR_R_CHAR_P` gets undefined because of a failing compilation check. An alternative would be to mark `c` as `__attribute__((undefined))`, but MSVC doesn't have `__attribute__((undefined))`. --- cmake/generateConfigFile.cmake | 1 + 1 file changed, 1 insertion(+) diff --git a/cmake/generateConfigFile.cmake b/cmake/generateConfigFile.cmake index 9fc4e001..adb58d5e 100644 --- a/cmake/generateConfigFile.cmake +++ b/cmake/generateConfigFile.cmake @@ -32,6 +32,7 @@ check_cxx_source_compiles( " int main() { char buff[100]; const char* c = strerror_r(0,buff,100); + (void)c; // ignore unuse-variable return 0; }" EXV_STRERROR_R_CHAR_P )