This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug fortran/53867] Probably a bogus warning on types


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.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]