Skip to content

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

Merged
Hallberg-NOAA merged 1 commit into
NOAA-GFDL:dev/gfdlfrom
marshallward:posix_jmp_fixes
May 27, 2023
Merged

POSIX: generic wrappers for all setjmp.h symbols#355
Hallberg-NOAA merged 1 commit into
NOAA-GFDL:dev/gfdlfrom
marshallward:posix_jmp_fixes

Conversation

@marshallward
Copy link
Copy Markdown
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
Copy Markdown

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
Copy Markdown
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