public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug fortran/102368] New: Failure to compile program using the C_SIZEOF function in ISO_C_BINDING
@ 2021-09-16 14:49 longb at cray dot com
  2021-11-11 22:21 ` [Bug fortran/102368] " anlauf at gcc dot gnu.org
                   ` (4 more replies)
  0 siblings, 5 replies; 6+ messages in thread
From: longb at cray dot com @ 2021-09-16 14:49 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=102368

            Bug ID: 102368
           Summary: Failure to compile program using the C_SIZEOF function
                    in ISO_C_BINDING
           Product: gcc
           Version: 11.2.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: fortran
          Assignee: unassigned at gcc dot gnu.org
          Reporter: longb at cray dot com
  Target Milestone: ---

> cat test.f90
program main
use,intrinsic ::  iso_c_binding
implicit none

character(kind=c_char, len=*), parameter :: blergh = 'abc'

print *, c_sizeof(blergh)
print *, c_sizeof(.true.)
print *, c_sizeof(5)
print *, c_sizeof(5.0)
print *, c_sizeof(5.0d0)
end program main

> gfortran test.f90
test.f90:7:18:

    7 | print *, c_sizeof(blergh)
      |                  1
Error: 'x' argument of 'c_sizeof' intrinsic at (1) must be an interoperable
data entity: Type shall have a character length of 1

> ifort test.f90
> ./a.out
                     3
                     4
                     4
                     4
                     8

gfortran appears to be using pre-F08 rules for C_SIZEOF.

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2021-11-13 21:15 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-09-16 14:49 [Bug fortran/102368] New: Failure to compile program using the C_SIZEOF function in ISO_C_BINDING longb at cray dot com
2021-11-11 22:21 ` [Bug fortran/102368] " anlauf at gcc dot gnu.org
2021-11-11 22:53 ` anlauf at gcc dot gnu.org
2021-11-12 17:41 ` anlauf at gcc dot gnu.org
2021-11-12 21:36 ` anlauf at gcc dot gnu.org
2021-11-13 21:15 ` anlauf at gcc dot gnu.org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).