Skip to content

fffpy.c: fix build failure with gcc 14. #568

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

Closed
wants to merge 2 commits into from
Closed

Conversation

emollier
Copy link
Contributor

@emollier emollier commented Sep 4, 2024

As initially reported in Debian bug #1075317, nipy fails to build from source with the following error since introduction of gcc 14, and the promotion of several warnings as errors:

../lib/fff_python_wrapper/fffpy.c:17:3: error: returning ‘void *’ from a function with return type ‘IMP_OUT’ {aka ‘int’} makes integer from pointer without a cast [-Wint-conversion]
   17 |   import_array();
      |   ^~~~~~~~~~~~

This looks to be related to the logic revolving around setting the type of IMP_OUT, as it does not know about the present import_array macro "return type" in contemporary Numpy versions. Since Python 2 is obsolete, this patch removes the Python major selector entirely to replace by a hard wiring of the IMP_OUT type.

This may not be 100% suitable to everyone, but the time of introduction of the void* return type to the import_array macro in Numpy is unclear.

emollier and others added 2 commits September 4, 2024 14:06
As initially reported in [Debian bug #1075317], nipy fails to build
from source with the following error since introduction of gcc 14, and
the promotion of several warnings as errors:

	../lib/fff_python_wrapper/fffpy.c:17:3: error: returning ‘void *’ from a function with return type ‘IMP_OUT’ {aka ‘int’} makes integer from pointer without a cast [-Wint-conversion]
	   17 |   import_array();
	      |   ^~~~~~~~~~~~

This looks to be related to the logic revolving around setting the
type of IMP_OUT, as it does not know about the present import_array
macro "return type" in contemporary Numpy versions.  Since Python 2 is
obsolete, this patch removes the Python major selector entirely to
replace by a hard wiring of the IMP_OUT type.

This may not be 100% suitable to everyone, but the time of
introduction of the void* return type to the import_array macro in
Numpy is unclear.

[Debian bug #1075317]: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1075317

Signed-off-by: Étienne Mollier <emollier@debian.org>
@effigies
Copy link
Member

effigies commented Oct 4, 2024

Included in #565.

@effigies effigies closed this Oct 4, 2024
Copy link

codecov bot commented Oct 4, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 84.61%. Comparing base (181ea05) to head (545ffd2).

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #568   +/-   ##
=======================================
  Coverage   84.61%   84.61%           
=======================================
  Files         293      293           
  Lines       27479    27479           
  Branches     3362     3362           
=======================================
  Hits        23252    23252           
  Misses       3273     3273           
  Partials      954      954           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

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
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy