From: Nathan Moinvaziri Date: Sat, 17 Oct 2020 21:31:07 +0000 (-0700) Subject: Fixed ptrdiff_t redefined static analysis warning on GCC. Failing ptrdiff_t detection... X-Git-Tag: v2.0.0-RC1~33 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=454f236235d7f71a69bea9348aae398d25755734;p=thirdparty%2Fzlib-ng.git Fixed ptrdiff_t redefined static analysis warning on GCC. Failing ptrdiff_t detection due to variable unused warning combined with -Werror. In file included from zlib-ng/zlib-ng.h:33, from zlib-ng/zutil.h:38, from zlib-ng/adler32.c:7: zlib-ng/zconf-ng.h:118:18: error: conflicting types for ‘ptrdiff_t’ 118 | typedef uint64_t ptrdiff_t; | ^~~~~~~~~ In file included from zlib-ng/zutil.h:31, from zlib-ng/adler32.c:7: stddef.h:143:26: note: previous declaration of ‘ptrdiff_t’ was here 143 | typedef __PTRDIFF_TYPE__ ptrdiff_t; | ^~~~~~~~~ --- diff --git a/CMakeLists.txt b/CMakeLists.txt index ce103f6a..66139a14 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -444,7 +444,7 @@ endif() # check_c_source_compiles( "#include - int main() { ptrdiff_t *a; return 0; }" + int main() { ptrdiff_t *a; (void)a; return 0; }" HAVE_PTRDIFF_T ) if(NOT HAVE_PTRDIFF_T)