Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

BUG: incompatible pointer type for npy_int32t and npy_uint32 on i686 #25869

Copy link
Copy link
Open
@opoplawski

Description

@opoplawski
Issue body actions

Describe the issue:

On i686, numpy defines:

  • npy_int32 type as long int.
  • npy_uint32 type as long unsigned int.
    These are incompatible with the stdint definitions of:
  • int32_t as int
  • uint32_t as unsigned int

This is causing h5py to fail to build on Fedora 40 due to the use of -Werror=incompatible-pointer-types. I think it's fairly reasonable to expect that the npy_*int* types to be completely interchangeable with the stdint types.

Reproduce the code example:

from numpy cimport int8_t, uint8_t, int16_t, uint16_t, int32_t, uint32_t, int64_t, uint64_t
...
    def read_direct_chunk(self, offsets, PropID dxpl=None, unsigned char[::1] out=None):
...
        cdef uint32_t filters
...
            H5Dread_chunk(dset_id, dxpl_id, offset, &filters, chunk_buffer)

Error message:

/builddir/build/BUILD/h5py-3.10.0/serial/h5py/defs.c: In function ‘__pyx_f_4h5py_4defs_H5Dread_chunk’:
/builddir/build/BUILD/h5py-3.10.0/serial/h5py/defs.c:14922:85: error: passing argument 4 of ‘H5Dread_chunk’ from incompatible pointer type [-Wincompatible-pointer-types]
14922 |         __pyx_v_r = H5Dread_chunk(__pyx_v_dset_id, __pyx_v_dxpl_id, __pyx_v_offset, __pyx_v_filters, __pyx_v_buf);
      |                     ^~~~~~~~~~~~~~~
      |                     |
      |                     __pyx_t_5numpy_uint32_t * {aka long unsigned int *}
In file included from /usr/include/hdf5.h:25,
                 from /builddir/build/BUILD/h5py-3.10.0/serial/h5py/api_compat.h:27,
                 from /builddir/build/BUILD/h5py-3.10.0/serial/h5py/defs.c:1246:
/usr/include/H5Dpublic.h:1003:92: note: expected ‘uint32_t *’ {aka ‘unsigned int *’} but argument is of type ‘__pyx_t_5numpy_uint32_t *’ {aka ‘long unsigned int *’}
 1003 | H5_DLL herr_t H5Dread_chunk(hid_t dset_id, hid_t dxpl_id, const hsize_t *offset, uint32_t *filters,
      |                  ~~~~~~~~~~^~~~~~~

Python and NumPy Versions:

1.26.2
3.12.2 (main, Feb 7 2024, 00:00:00) [GCC 14.0.1 20240127 (Red Hat 14.0.1-0)]

Runtime Environment:

No response

Context for the issue:

No response

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      Morty Proxy This is a proxified and sanitized view of the page, visit original site.