Skip to content

Commit 58a9248

Browse files
committed
doc [skip ci]
1 parent 4a7c43d commit 58a9248

File tree

2 files changed

+7
-0
lines changed

2 files changed

+7
-0
lines changed

README.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,10 @@ There are also some Fortran main programs calling C or C++.
7676

7777
The examples "array", "malloc", "vector" show distinct ways to send arrays to/from Fortran with C and C++.
7878

79+
### bool
80+
81+
Made workaround for [nvfortran](https://forums.developer.nvidia.com/t/nvfortran-c-bool-bind-c-not-improper-value/291896).
82+
7983
### Error handling
8084

8185
Using Fortran statement "stop" or "error stop" with a C/C++ main program works like with a Fortran main program.

src/bool/logbool.f90

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,9 @@ logical(c_bool) function logical_not(L) bind(C)
2020
Ld = .false.
2121

2222
!> workaround for nvfortran 24.3 etc.
23+
!! nvfortran reference guide:
24+
!! The logical constants .TRUE. and .FALSE. are defined to be the four-byte values -1 and 0 respectively.
25+
!! A logical expression is defined to be .TRUE. if its least significant bit is 1 and .FALSE. otherwise.
2326
! logical_not = .not. L
2427
if(L) then
2528
logical_not = .false._C_BOOL

0 commit comments

Comments
 (0)