Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Compile warnings in minizip #381

Closed
jeroen opened this issue Oct 17, 2022 · 7 comments
Closed

Compile warnings in minizip #381

jeroen opened this issue Oct 17, 2022 · 7 comments
Assignees

Comments

@jeroen
Copy link

jeroen commented Oct 17, 2022

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]
@jmcnamara jmcnamara self-assigned this Oct 17, 2022
@jmcnamara
Copy link
Owner

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

@jmcnamara
Copy link
Owner

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.

@jeroen
Copy link
Author

jeroen commented Oct 17, 2022

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

@jmcnamara
Copy link
Owner

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.

@jeroen
Copy link
Author

jeroen commented 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.

@jmcnamara
Copy link
Owner

The writexl fix for reference: ropensci/writexl@75c7029

@jmcnamara
Copy link
Owner

Fixed on main. Thanks for the report.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants