public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "longb at cray dot com" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug fortran/102368] New: Failure to compile program using the C_SIZEOF function in ISO_C_BINDING
Date: Thu, 16 Sep 2021 14:49:38 +0000	[thread overview]
Message-ID: <bug-102368-4@http.gcc.gnu.org/bugzilla/> (raw)

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.

             reply	other threads:[~2021-09-16 14:49 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-09-16 14:49 longb at cray dot com [this message]
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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=bug-102368-4@http.gcc.gnu.org/bugzilla/ \
    --to=gcc-bugzilla@gcc.gnu.org \
    --cc=gcc-bugs@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).