Skip to content

Commit

Permalink
#31 Fix build failure with "c++-compat" warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
pmqs committed Feb 26, 2024
1 parent 657ba62 commit d9af6f8
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 5 deletions.
8 changes: 7 additions & 1 deletion .github/workflows/linux.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
2 changes: 1 addition & 1 deletion Zlib.xs
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}


Expand Down
6 changes: 3 additions & 3 deletions zlib-src/zconf.h
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit d9af6f8

Please sign in to comment.