[Bug fortran/53867] Probably a bogus warning on types
dominiq at lps dot ens.fr
gcc-bugzilla@gcc.gnu.org
Fri Oct 9 13:28:00 GMT 2015
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=53867
Dominique d'Humieres <dominiq at lps dot ens.fr> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|UNCONFIRMED |WAITING
Last reconfirmed| |2015-10-09
Ever confirmed|0 |1
--- Comment #1 from Dominique d'Humieres <dominiq at lps dot ens.fr> ---
Consider the following test:
module EnumKind
use, intrinsic :: iso_c_binding
enum, bind(c)
enumerator :: A
end enum
integer, parameter :: K = kind(a)
type, bind(c) :: T
integer(K) :: C
end type T
type, bind(c) :: Ti
integer :: C
end type Ti
type, bind(c) :: Tc
integer(c_int) :: C
end type Tc
end module EnumKind
use EnumKind
type(T) :: tt
type(Ti) :: tti
type(Tc) :: ttc
print *, sizeof(tt%c)
print *, sizeof(tti%c)
print *, sizeof(ttc%c)
end
when compiled with the option -fdefault-integer-8 (see pr32957), the run time
output is
4
8
4
which shows that tti%c is not C interoperable. In a similar way I don't think
there is any guarantee that K is 4. IMO the warning make sense for both cases.
More information about the Gcc-bugs
mailing list