Skip to content

Comments

Add FLINT_NORETURN to function pointer argument#2383

Merged
albinahlback merged 1 commit intoflintlib:mainfrom
albinahlback:fix_noreturn_function_pointers
Jul 27, 2025
Merged

Add FLINT_NORETURN to function pointer argument#2383
albinahlback merged 1 commit intoflintlib:mainfrom
albinahlback:fix_noreturn_function_pointers

Conversation

@albinahlback
Copy link
Collaborator

In flint_set_abort and flint_set_throw

Solves #2382

@mkoeppe can you check if this solves the issue?

@mkoeppe
Copy link
Contributor

mkoeppe commented Jul 24, 2025

@mkoeppe
Copy link
Contributor

mkoeppe commented Jul 24, 2025

Fails on Linux - for example https://github.com/passagemath/upstream-flint/actions/runs/16507861680/job/46683183957#step:11:5502

  [flint-git]   [spkg-install] /sage/local/var/tmp/sage/build/flint-git/src/src/generic_files/exception.c:47:6: error: conflicting types for 'flint_set_abort'; have 'void(__attribute__((noreturn)) void (*)(void))'
  [flint-git]   [spkg-install]    47 | void flint_set_abort(void (* func)(void) FLINT_NORETURN)
  [flint-git]   [spkg-install]       |      ^~~~~~~~~~~~~~~
  [flint-git]   [spkg-install] In file included from /sage/local/var/tmp/sage/build/flint-git/src/src/generic_files/exception.c:15:
  [flint-git]   [spkg-install] /sage/local/var/tmp/sage/build/flint-git/src/src/flint.h:243:6: note: previous declaration of 'flint_set_abort' with type 'void(void (*)(void))'

@albinahlback
Copy link
Collaborator Author

This should work, albeit very ugly

mkoeppe added a commit to passagemath/passagemath that referenced this pull request Jul 24, 2025
@mkoeppe
Copy link
Contributor

mkoeppe commented Jul 24, 2025

OK, this works, thanks very much @albinahlback

In only source for flint_set_abort and flint_set_throw.
@albinahlback albinahlback force-pushed the fix_noreturn_function_pointers branch from 2e8cbcb to 74f787b Compare July 27, 2025 18:48
@albinahlback albinahlback merged commit ac2ca8d into flintlib:main Jul 27, 2025
10 checks passed
@albinahlback albinahlback deleted the fix_noreturn_function_pointers branch July 31, 2025 22:53
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