diff --git a/.github/workflows/linux.yml b/.github/workflows/linux.yml index ef8a982..954b9ad 100644 --- a/.github/workflows/linux.yml +++ b/.github/workflows/linux.yml @@ -30,11 +30,16 @@ jobs: - '5.10' - '5.8' - '5.6' + build-zlib: - 0 - 1 - name: Perl ${{ matrix.perl }} BUILD_ZLIB:${{matrix.build-zlib}} + cc-opts: + - "" + - "-Wc++-compat" + + name: Perl ${{ matrix.perl }} BUILD_ZLIB:${{matrix.build-zlib}} ${{matrix.cc-opts}} steps: - uses: actions/checkout@v4 - name: Setup perl @@ -49,5 +54,6 @@ jobs: run: perl Makefile.PL && make env: BUILD_ZLIB: ${{matrix.build-zlib}} + PERL_MM_OPT: CCFLAGS="-Werror ${{matrix.cc-opts}}" - name: Test run: make test diff --git a/Zlib.xs b/Zlib.xs index 22467ef..c9a07a7 100644 --- a/Zlib.xs +++ b/Zlib.xs @@ -656,7 +656,7 @@ voidpf my_zcalloc (voidpf opaque, unsigned items, unsigned size) PERL_UNUSED_VAR(opaque); /* TODO - put back to calloc */ /* return safecalloc(items, size); */ - return safemalloc(items* size); + return (voidpf)safemalloc(items* size); } diff --git a/zlib-src/zconf.h b/zlib-src/zconf.h index 46a305f..703b7ef 100644 --- a/zlib-src/zconf.h +++ b/zlib-src/zconf.h @@ -408,12 +408,12 @@ typedef uLong FAR uLongf; #ifdef STDC typedef void const *voidpc; - typedef void FAR *voidpf; + typedef Bytef *voidpf; typedef Bytef *voidp; #else typedef Byte const *voidpc; - typedef Byte FAR *voidpf; - typedef Byte *voidp; + typedef Bytef *voidpf; + typedef Bytef *voidp; #endif #if !defined(Z_U4) && !defined(Z_SOLO) && defined(STDC)