Skip to content

Conversation

@bonachea
Copy link
Member

This PR deploys use of selected_logical_kind in the definition of PRIF_ATOMIC_LOGICAL_KIND for gfortran 15 (the first release version where it appears).
This resolves multiple (harmless) warnings from gfortran (15) of the form shown below, and improves our spec compliance.

././src/prif.F90:1160:13:

 1160 |       logical(PRIF_ATOMIC_LOGICAL_KIND), intent(out) :: value
      |             1
Warning: C kind type parameter is for type INTEGER but type at (1) is LOGICAL

* PRIF does not require these parameter values to have any particular kind.
  flang internally defines these parameters to be default integer,
  and gfortran generates spurious warnings when they are not so change
  them to default integer.
* Add a HAVE_LOGICAL64 compile-time option to accomodate (theoretical)
  compilers that provide logical64 but lack selected_logical_kind.
This silences a (harmless) warning
@bonachea bonachea requested a review from ktras January 24, 2026 03:20
Copy link
Collaborator

@ktras ktras left a comment

Choose a reason for hiding this comment

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

@bonachea Everything looks good except I don't know why these integer constants being changed from integer(c_int to integer.

@bonachea
Copy link
Member Author

I don't know why these integer constants being changed from integer(c_int to integer.

Apologies, this is explained in the commit message:

  • PRIF does not require these parameter values to have any particular kind.
    flang internally defines these parameters to be default integer,
    and gfortran generates spurious warnings when they are not so change
    them to default integer.

@bonachea bonachea requested a review from ktras January 27, 2026 18:57
Copy link
Collaborator

@ktras ktras left a comment

Choose a reason for hiding this comment

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

LGTM

@bonachea bonachea merged commit 6cd33db into BerkeleyLab:main Jan 27, 2026
34 checks passed
@bonachea bonachea deleted the tweak-atomic-logical-kind branch January 27, 2026 19:01
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