public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "burnus at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug fortran/46020] Improve error string for BIND(C) diagnostic for len>1 character return type
Date: Thu, 14 Oct 2010 17:15:00 -0000	[thread overview]
Message-ID: <20101014171500.C7tYuqwUjspVvrAcvL7IS-T8Ai35CGvPbGbt3Z7C4Vw@z> (raw)
In-Reply-To: <bug-46020-4@http.gcc.gnu.org/bugzilla/>

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

--- Comment #1 from Tobias Burnus <burnus at gcc dot gnu.org> 2010-10-14 17:14:45 UTC ---
Thinking of it again, one probably needs also NAGs error message as:

FUNCTION F_X(A) bind(c,name='F_X')
   CHARACTER*(*) F_X
END FUNCTION

...

interface
  FUNCTION F_X(A) bind(c,name='F_X')
     CHARACTER*(1) F_X
  END FUNCTION
end interface

is also invalid - even though the effective string length is one;

F2008 has: "If the type is character, the length type parameter is
interoperable if and only if its value is one." [...]

[only interoperable] "if it is of type character its length is not assumed or
declared by an expression that is not a constant expression."

Thus, one could think of handling the assumed length case explicitly. Or one
uses, e.g.

Error: Return type of BIND(C) function 'f_x' at (1) of character type must have
length 1


  reply	other threads:[~2010-10-14 17:15 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-10-14 17:08 [Bug fortran/46020] New: " burnus at gcc dot gnu.org
2010-10-14 17:15 ` burnus at gcc dot gnu.org [this message]
2010-11-26  5:00 ` [Bug fortran/46020] " aoliva at gcc dot gnu.org
2010-11-26  5:50 ` aoliva at gcc dot gnu.org
2010-12-06 12:55 ` aoliva at gcc dot gnu.org
2010-12-06 13:04 ` aoliva at gcc dot gnu.org
2010-12-06 13:12 ` aoliva at gcc dot gnu.org
2010-12-06 13:40 ` burnus at gcc dot gnu.org
2014-03-22 19:43 ` dominiq at lps dot ens.fr

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=20101014171500.C7tYuqwUjspVvrAcvL7IS-T8Ai35CGvPbGbt3Z7C4Vw@z \
    --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).