]> git.ipfire.org Git - thirdparty/zlib-ng.git/commitdiff
Fixed ptrdiff_t redefined static analysis warning on GCC. Failing ptrdiff_t detection...
authorNathan Moinvaziri <nathan@nathanm.com>
Sat, 17 Oct 2020 21:31:07 +0000 (14:31 -0700)
committerHans Kristian Rosbach <hk-github@circlestorm.org>
Sun, 18 Oct 2020 13:39:11 +0000 (15:39 +0200)
  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;
        |                          ^~~~~~~~~

CMakeLists.txt

index ce103f6a7ccdcc47362c84c2bfe9fab6493d6da1..66139a14fc341aaeafad7d81fbd210a52e305c65 100644 (file)
@@ -444,7 +444,7 @@ endif()
 #
 check_c_source_compiles(
     "#include <stddef.h>
-     int main() { ptrdiff_t *a; return 0; }"
+     int main() { ptrdiff_t *a; (void)a; return 0; }"
     HAVE_PTRDIFF_T
 )
 if(NOT HAVE_PTRDIFF_T)