From 8f5cdac36df9020aebbab0ccb17270177b9deb6f Mon Sep 17 00:00:00 2001 From: Orgad Shaneh Date: Thu, 16 May 2019 10:28:20 +0300 Subject: [PATCH] Subject: [PATCH] Fix bzero misdetection also for GCC >=8 The fix in 1d6128d1fe76e6148cd9955db38be39481526f65 worked for MinGW with GCC7, but GCC8 evidentially got smarter, and it also substitutes bzero->memset for larger arrays. Set the emitted warning as an error to avoid misdetection. --- CMakeLists.txt | 3 +++ 1 file changed, 3 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index e70522e35..fa7521d3b 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -719,6 +719,9 @@ endif() CHECK_C_SOURCE_COMPILES( "#include + #if __GNUC__ + #pragma GCC diagnostic error \"-Wimplicit-function-declaration\" + #endif int main(int argc, char **argv) { char buf[100]; bzero(buf, 100); return 0; } " LWS_HAVE_BZERO) CHECK_C_SOURCE_COMPILES(