[Bug fortran/47605] New: Document that C_Bool might be the wrong constant for C Booleans

burnus at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Fri Feb 4 07:17:00 GMT 2011


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=47605

           Summary: Document that C_Bool might be the wrong constant for C
                    Booleans
           Product: gcc
           Version: 4.6.0
            Status: UNCONFIRMED
          Keywords: documentation
          Severity: normal
          Priority: P3
         Component: fortran
        AssignedTo: unassigned@gcc.gnu.org
        ReportedBy: burnus@gcc.gnu.org


James pointed out the following at
http://groups.google.com/group/comp.lang.fortran/browse_thread/thread/3c2784c55d402ced

c_bool is typically one byte wide, and c_int 4. That means: Most C programs -
except of those few which explicitly use _Bool, use a 4 byte and not a 1 byte
Boolean variables.

I think one should put a warning into the manual - either in the C Binding part
[1] or in the section about the ISO C Binding constants [2], or in both.

[1] http://gcc.gnu.org/onlinedocs/gfortran/Intrinsic-Types.html
[2]http://gcc.gnu.org/onlinedocs/gfortran/ISO_005fC_005fBINDING.html



More information about the Gcc-bugs mailing list