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

Build of minizip fails on macOS with clang12 #11

Open
RobertHilbrich opened this issue Oct 30, 2020 · 1 comment
Open

Build of minizip fails on macOS with clang12 #11

RobertHilbrich opened this issue Oct 30, 2020 · 1 comment

Comments

@RobertHilbrich
Copy link

Hi,
GitHub actions recently switched to clang 12 from clang 11, which led to FMIL no longer building for us on macOS. The reason is, that minizip fails to build properly.

Clang 12 build:

#ifdef unix || __APPLE__
            ^
            //
/Users/runner/work/sumo/sumo/fmuChecker/FMIL/ThirdParty/Minizip/minizip/miniunz.c:143:11: error: implicit declaration of function 'mkdir' is invalid in C99 [-Werror,-Wimplicit-function-declaration]
    ret = mkdir (dirname,0775);
          ^
/Users/runner/work/sumo/sumo/fmuChecker/FMIL/ThirdParty/Minizip/minizip/miniunz.c:432:25: warning: passing 'const char *' to parameter of type 'char *' discards qualifiers [-Wincompatible-pointer-types-discards-qualifiers]
                makedir(write_filename);
                        ^~~~~~~~~~~~~~
2 warnings and 1 error generated.

Clang 11 build:

miniunz.c:110:13: warning: extra tokens at end of #ifdef directive [-Wextra-tokens]
#ifdef unix || __APPLE__
            ^
            //
miniunz.c:143:11: warning: implicit declaration of function 'mkdir' is invalid in C99
      [-Wimplicit-function-declaration]
    ret = mkdir (dirname,0775);
          ^
miniunz.c:432:25: warning: passing 'const char *' to parameter of type 'char *' discards qualifiers
      [-Wincompatible-pointer-types-discards-qualifiers]
                makedir(write_filename);
                        ^~~~~~~~~~~~~~
3 warnings generated.

Is there anything you can do to fix this issue? Maybe adding a header file? Like proposed here?

@adamjstewart
Copy link

For what it's worth, I added #include <sys/stat.h> to miniunz.c like suggested in that post and the build works for me. Not sure if it works on all systems or with all compilers though. minizip is part of zlib, but I'm not sure how to contribute fixes to zlib.

beutlich pushed a commit to fmi-tools/fmi-library that referenced this issue Apr 1, 2021
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