Summary: | Document that C_Bool might be the wrong constant for C Booleans | ||
---|---|---|---|
Product: | gcc | Reporter: | Tobias Burnus <burnus> |
Component: | fortran | Assignee: | Not yet assigned to anyone <unassigned> |
Status: | RESOLVED FIXED | ||
Severity: | normal | Keywords: | documentation |
Priority: | P3 | ||
Version: | 4.6.0 | ||
Target Milestone: | --- | ||
Host: | Target: | ||
Build: | Known to work: | ||
Known to fail: | Last reconfirmed: | 2014-03-22 00:00:00 |
Description
Tobias Burnus
2011-02-04 07:17:13 UTC
In [1] I see
> For logical types, please note that the Fortran standard only guarantees
> interoperability between C99's _Bool and Fortran's C_Bool-kind logicals and C99
> defines that true has the value 1 and false the value 0. Using any other integer
> value with GNU Fortran's LOGICAL (with any kind parameter) gives an undefined
> result. (Passing other integer values than 0 and 1 to GCC's _Bool is also
> undefined, unless the integer is explicitly or implicitly casted to _Bool.)
What should be added to that?
> > For logical types, please note that the Fortran standard only guarantees > > interoperability between C99's _Bool and Fortran's C_Bool-kind logicals and C99 > > defines that true has the value 1 and false the value 0. Using any other integer > > value with GNU Fortran's LOGICAL (with any kind parameter) gives an undefined > > result. (Passing other integer values than 0 and 1 to GCC's _Bool is also > > undefined, unless the integer is explicitly or implicitly casted to _Bool.) > > What should be added to that? No answer for over a year. Closing as FIXED. |