Repository navigation
Declare enum-valued arguments integer(c_int) in the bind(C) interfaces - #586
Merged
Merged
Conversation
integer(kind(<enumerator>)) is the same type as integer(c_int), but gfortran -Wall reported every occurrence in a bind(C) interface as possibly not C interoperable (-Wc-binding-type), about 12,000 warnings over the modules. The module procedures keep the enum's name in their kind. Regenerated with rocm-fortran 2bbcea6, symbol tests included.
amontoison
force-pushed
the
c_int_enums
branch
from
October 9, 2026 03:15
4d74c99 to
90244e4
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
integer(kind(<enumerator>))is the same type asinteger(c_int), because the enumerators of anenum, bind(c)have the kind of a C int. gfortran-Wallstill reports every occurrence in a bind(C) interface as possibly not C interoperable (-Wc-binding-type), about 12,000 warnings over the modules. The bind(C) specifics now declare these arguments and resultsinteger(c_int). The module procedures (_typed,_devptr, array overloads) keep the enum's name in their kind. Interfaces that no longer use an enum also drop theiruse hipfort_*_enums.Nothing changes for callers: the types are identical, and
integer(c_int)comes from standardISO_C_BINDING, so every compiler supports it.Regenerated with rocm-fortran 2bbcea6, including the symbol tests.
Warnings when compiling
lib/hipfort(default,-DUSE_ASSUMED_RANK,-DUSE_ASSUMED_SHAPE,-DUSE_ASSUMED_SHAPE -DUSE_CUDA_NAMES):-Wall-pedanticFull build with
-DHIPFORT_EXTENDED_TESTS=ON(gfortran): 0 warnings. ctest on GPU: 1266/1269 pass. The 3 failures (hip_mem_advisef2003/f2008,hip_module_kernel) are the known WSL-only failures and also happen ondevelop.