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

Compilation errors in gcc-14 #153

Open
sjforeman opened this issue Jul 17, 2024 · 0 comments
Open

Compilation errors in gcc-14 #153

sjforeman opened this issue Jul 17, 2024 · 0 comments

Comments

@sjforeman
Copy link

OS: macOS Sonoma 14.5
Chip: Apple M3 Pro
Python: Python 3.10.14
Compiler: gcc 14.1.0

Attempting to pip-install bitshuffle in the above setup yields the following:

gcc -Wno-unused-result -Wsign-compare -Wunreachable-code -DNDEBUG -fwrapv -O2 -Wall -fPIC -O2 -isystem /opt/homebrew/Caskroom/miniforge/base/include -arch arm64 -fPIC -O2 -isystem /opt/homebrew/Caskroom/miniforge/base/include -arch arm64 -Ilzf/ -Ilzf/lzf/ -I/opt/homebrew/Cellar/hdf5/1.14.3_1/include -I/Users/sforeman/Desktop/venv/include -I/opt/homebrew/Caskroom/miniforge/base/include/python3.10 -c lzf/lzf_filter.c -o build/temp.macosx-11.0-arm64-cpython-310/lzf/lzf_filter.o -mcpu=native -O3 -fno-strict-aliasing -fPIC -ffast-math -std=c99
      lzf/lzf_filter.c: In function 'register_lzf':
      lzf/lzf_filter.c:85:9: error: initialization of 'int' from 'char *' makes integer from pointer without a cast [-Wint-conversion]
         85 |         "lzf",
            |         ^~~~~
      lzf/lzf_filter.c:85:9: note: (near initialization for 'filter_class.id')
      lzf/lzf_filter.c:86:9: error: initialization of 'unsigned int' from 'void *' makes integer from pointer without a cast [-Wint-conversion]
         86 |         NULL,
            |         ^~~~
      lzf/lzf_filter.c:86:9: note: (near initialization for 'filter_class.encoder_present')
      lzf/lzf_filter.c:87:9: error: initialization of 'unsigned int' from 'herr_t (*)(hid_t,  hid_t,  hid_t)' {aka 'int (*)(long long int,  long long int,  long long int)'} makes integer from pointer without a cast [-Wint-conversion]
         87 |         (H5Z_set_local_func_t)(lzf_set_local),
            |         ^
      lzf/lzf_filter.c:87:9: note: (near initialization for 'filter_class.decoder_present')
      lzf/lzf_filter.c:88:9: error: initialization of 'const char *' from incompatible pointer type 'size_t (*)(unsigned int,  size_t,  const unsigned int *, size_t,  size_t *, void **)' {aka 'long unsigned int (*)(unsigned int,  long unsigned int,  const unsigned int *, long unsigned int,  long unsigned int *, void **)'} [-Wincompatible-pointer-types]
         88 |         (H5Z_func_t)(lzf_filter)
            |         ^
      lzf/lzf_filter.c:88:9: note: (near initialization for 'filter_class.name')
      error: command '/opt/homebrew/bin/clang' failed with exit code 1

The failures occur because the int-conversion and incompatible-pointer-types warnings are treated as errors. According to https://gcc.gnu.org/gcc-14/porting_to.html#warnings-as-errors, these warnings are treated as errors in gcc-14, but were treated as warnings by default in gcc-13 and earlier. I find that bitshuffle compiles and installs without issue in gcc-13. Altering the lines reference above should be sufficient to restore gcc-14 compatibility.

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

1 participant