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

POSIX: generic wrappers for all setjmp.h symbols #355

Merged
merged 1 commit into from
May 27, 2023

Conversation

marshallward
Copy link
Member

This patch extends the generic wrappers of sigsetjmp to all of the *jmp wrapper functions in <setjmp.h>

The C standard allows these to be defined as macros, rather than explicit functions, which cannot be referenced by Fortran C bindings, so we cannot assume that these functions exist, even when using a compliant libc.

As with sigsetjmp, these functions are now disabled on default, and raise a runtime error if called by the program. Realistically, they will only be defined by an autoconf-configured build.

This is required for older Linux distributions where libc does not define longjmp.

@codecov
Copy link

codecov bot commented Apr 21, 2023

Codecov Report

Merging #355 (da5cac4) into dev/gfdl (89f91bd) will decrease coverage by 0.01%.
The diff coverage is 0.00%.

❗ Current head da5cac4 differs from pull request most recent head 8ed7eb0. Consider uploading reports for the commit 8ed7eb0 to get more accurate results

@@             Coverage Diff              @@
##           dev/gfdl     #355      +/-   ##
============================================
- Coverage     38.13%   38.13%   -0.01%     
============================================
  Files           269      269              
  Lines         75731    75743      +12     
  Branches      13926    13926              
============================================
  Hits          28882    28882              
- Misses        41650    41662      +12     
  Partials       5199     5199              
Impacted Files Coverage Δ
src/framework/posix.F90 38.88% <0.00%> (-11.12%) ⬇️

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

This patch extends the generic wrappers of sigsetjmp to all of the *jmp
wrapper functions in <setjmp.h>

The C standard allows these to be defined as macros, rather than
explicit functions, which cannot be referenced by Fortran C bindings, so
we cannot assume that these functions exist, even when using a compliant
libc.

As with sigsetjmp, these functions are now disabled on default, and
raise a runtime error if called by the program.  Realistically, they
will only be defined by an autoconf-configured build.

This is required for older Linux distributions where libc does not
define longjmp.
Copy link
Member

@Hallberg-NOAA Hallberg-NOAA left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These changes look reasonable to me, and they have passed the pipeline testing at
https://gitlab.gfdl.noaa.gov/ogrp/MOM6/-/pipelines/19305 .

@Hallberg-NOAA Hallberg-NOAA merged commit 50d8bda into NOAA-GFDL:dev/gfdl May 27, 2023
@marshallward marshallward deleted the posix_jmp_fixes branch July 21, 2023 14:40
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