[GH-ISSUE #381] Compile warnings in minizip #306

Closed
opened 2026-05-05 12:07:41 -06:00 by gitea-mirror · 7 comments
Owner

Originally created by @jeroen on GitHub (Oct 17, 2022).
Original GitHub issue: https://github.com/jmcnamara/libxlsxwriter/issues/381

Originally assigned to: @jmcnamara on GitHub.

We see these warnings when compiling with -Wstrict-prototypes

minizip/ioapi.c:234:6: warning: a function definition without a prototype is deprecated in all versions of C and is not supported in C2x [-Wdeprecated-non-prototype]
minizip/zip.c:189:60: warning: a function declaration without a prototype is deprecated in all versions of C [-Wstrict-prototypes]
Originally created by @jeroen on GitHub (Oct 17, 2022). Original GitHub issue: https://github.com/jmcnamara/libxlsxwriter/issues/381 Originally assigned to: @jmcnamara on GitHub. We see these warnings when compiling with `-Wstrict-prototypes` ``` minizip/ioapi.c:234:6: warning: a function definition without a prototype is deprecated in all versions of C and is not supported in C2x [-Wdeprecated-non-prototype] minizip/zip.c:189:60: warning: a function declaration without a prototype is deprecated in all versions of C [-Wstrict-prototypes] ```
Author
Owner

@jmcnamara commented on GitHub (Oct 17, 2022):

Thanks for the report. What OS and compiler version are you using?

<!-- gh-comment-id:1280543489 --> @jmcnamara commented on GitHub (Oct 17, 2022): Thanks for the report. What OS and compiler version are you using?
Author
Owner

@jmcnamara commented on GitHub (Oct 17, 2022):

I can't reproduce this on macOS:

/tmp$ git clone git@github.com:jmcnamara/libxlsxwriter.git
Cloning into 'libxlsxwriter'...


/tmp$ cd libxlsxwriter/

/tmp/libxlsxwriter$ CFLAGS=-Wstrict-prototypes make V=1 third_party
/Applications/Xcode.app/Contents/Developer/usr/bin/make -C third_party/minizip
cc         -c -Wstrict-prototypes -O3 -DNOCRYPT -DNOUNCRYPT  ioapi.c
cc         -c -Wstrict-prototypes -O3 -DNOCRYPT -DNOUNCRYPT  zip.c
cc -fPIC -c -Wstrict-prototypes -O3 -DNOCRYPT -DNOUNCRYPT  ioapi.c -o ioapi.so
cc -fPIC -c -Wstrict-prototypes -O3 -DNOCRYPT -DNOUNCRYPT  zip.c -o zip.so
/Applications/Xcode.app/Contents/Developer/usr/bin/make -C third_party/tmpfileplus
cc         -c -Wstrict-prototypes  tmpfileplus.c
cc -fPIC -c -Wstrict-prototypes  tmpfileplus.c -o tmpfileplus.so
/Applications/Xcode.app/Contents/Developer/usr/bin/make -C third_party/md5
cc         -c -Wstrict-prototypes  md5.c
cc -fPIC -c -Wstrict-prototypes  md5.c -o md5.so

/tmp/libxlsxwriter (main)$ clang --version
Apple clang version 11.0.0 (clang-1100.0.33.17)

I'll try with some Linux variants.

By the way, the minizip code is third party code from the zlib examples. It may not be warning free with recent compilers. It is probably best not to compile it with additional constraints. It is also possible to link against libminizip so that you don't have to compile it: https://libxlsxwriter.github.io/getting_started.html#gsg_minizip

The libxlsxwriter code itself should be warning clean with -Wstrict-prototypes.

<!-- gh-comment-id:1280593730 --> @jmcnamara commented on GitHub (Oct 17, 2022): I can't reproduce this on macOS: ``` /tmp$ git clone git@github.com:jmcnamara/libxlsxwriter.git Cloning into 'libxlsxwriter'... /tmp$ cd libxlsxwriter/ /tmp/libxlsxwriter$ CFLAGS=-Wstrict-prototypes make V=1 third_party /Applications/Xcode.app/Contents/Developer/usr/bin/make -C third_party/minizip cc -c -Wstrict-prototypes -O3 -DNOCRYPT -DNOUNCRYPT ioapi.c cc -c -Wstrict-prototypes -O3 -DNOCRYPT -DNOUNCRYPT zip.c cc -fPIC -c -Wstrict-prototypes -O3 -DNOCRYPT -DNOUNCRYPT ioapi.c -o ioapi.so cc -fPIC -c -Wstrict-prototypes -O3 -DNOCRYPT -DNOUNCRYPT zip.c -o zip.so /Applications/Xcode.app/Contents/Developer/usr/bin/make -C third_party/tmpfileplus cc -c -Wstrict-prototypes tmpfileplus.c cc -fPIC -c -Wstrict-prototypes tmpfileplus.c -o tmpfileplus.so /Applications/Xcode.app/Contents/Developer/usr/bin/make -C third_party/md5 cc -c -Wstrict-prototypes md5.c cc -fPIC -c -Wstrict-prototypes md5.c -o md5.so /tmp/libxlsxwriter (main)$ clang --version Apple clang version 11.0.0 (clang-1100.0.33.17) ``` I'll try with some Linux variants. By the way, the minizip code is third party code from the zlib examples. It may not be warning free with recent compilers. It is probably best not to compile it with additional constraints. It is also possible to link against libminizip so that you don't have to compile it: https://libxlsxwriter.github.io/getting_started.html#gsg_minizip The libxlsxwriter code itself should be warning clean with `-Wstrict-prototypes`.
Author
Owner

@jeroen commented on GitHub (Oct 17, 2022):

This happens with clang 15 and gcc 12 (tested on both debian and fedora).

<!-- gh-comment-id:1280705089 --> @jeroen commented on GitHub (Oct 17, 2022): This happens with clang 15 and gcc 12 (tested on both debian and fedora).
Author
Owner

@jmcnamara commented on GitHub (Oct 17, 2022):

I'll look into it, but since it is third party code it may not be fixed externally in which case it won't be fixable.

Could you disable, or not add that check for that part of the compilation? It is a pretty harmless warning and libxlsxwriter should be warning free.

<!-- gh-comment-id:1280722027 --> @jmcnamara commented on GitHub (Oct 17, 2022): I'll look into it, but since it is third party code it may not be fixed externally in which case it won't be fixable. Could you disable, or not add that check for that part of the compilation? It is a pretty harmless warning and libxlsxwriter should be warning free.
Author
Owner

@jeroen commented on GitHub (Oct 17, 2022):

This is enforced downstream in the CRAN repository in prep for C23, I cannot disable this unfortunately: https://cran.r-project.org/web/checks/check_results_writexl.html

But I can fix it in my copy of the vendored writexl code, the solution is trivial.

<!-- gh-comment-id:1280762025 --> @jeroen commented on GitHub (Oct 17, 2022): This is enforced downstream in the CRAN repository in prep for C23, I cannot disable this unfortunately: https://cran.r-project.org/web/checks/check_results_writexl.html But I can fix it in my copy of the vendored writexl code, the solution is trivial.
Author
Owner

@jmcnamara commented on GitHub (Oct 18, 2022):

The writexl fix for reference: 75c7029626

<!-- gh-comment-id:1282112669 --> @jmcnamara commented on GitHub (Oct 18, 2022): The writexl fix for reference: https://github.com/ropensci/writexl/commit/75c70296260b70b2c08aa412117b4f96c495bfbf
Author
Owner

@jmcnamara commented on GitHub (Dec 29, 2022):

Fixed on main. Thanks for the report.

<!-- gh-comment-id:1367590961 --> @jmcnamara commented on GitHub (Dec 29, 2022): Fixed on main. Thanks for the report.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: github-starred/libxlsxwriter#306
No description provided.