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

Fix incorrect const qualifier in membuf.pyx #1397

Merged
merged 1 commit into from
Feb 19, 2025
Merged

Conversation

shoyer
Copy link
Contributor

@shoyer shoyer commented Feb 15, 2025

Without this change, I see errors when building netCDF4-python, originating at the line free(self.memory) in __dealloc__():

.../_cython/_netCDF4.cc:12922:3: error: no matching function for call to 'free'
 12922 |   free(__pyx_v_self->memory);
       |   ^~~~
.../include/stdlib.h:563:13: note: candidate function not viable: 1st argument ('const void *') would lose const qualifier
  563 | extern void free (void *__ptr) __THROW;
      |             ^     ~~~~~~~~~~~

Apparently it is not valid to call free() on a const variable.

Without this change, I see errors when building netCDF4-python,
originating at the line `free(self.memory)` in  `__dealloc__()`:

    .../_cython/_netCDF4.cc:12922:3: error: no matching function for call to 'free'
     12922 |   free(__pyx_v_self->memory);
           |   ^~~~
    .../include/stdlib.h:563:13: note: candidate function not viable: 1st argument ('const void *') would lose const qualifier
      563 | extern void free (void *__ptr) __THROW;
          |             ^     ~~~~~~~~~~~

Apparently it is not valid call `free()` on a `const` variable.
@jswhit
Copy link
Collaborator

jswhit commented Feb 19, 2025

MPI tests are failing, but that's unrelated. Merging now.

@jswhit jswhit closed this Feb 19, 2025
@jswhit jswhit reopened this Feb 19, 2025
@jswhit jswhit merged commit 555fe9d into Unidata:master Feb 19, 2025
36 of 54 checks passed
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

Successfully merging this pull request may close these issues.

2 participants