public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug fortran/46020] New: Improve error string for BIND(C) diagnostic for len>1 character return type
@ 2010-10-14 17:08 burnus at gcc dot gnu.org
  2010-10-14 17:15 ` [Bug fortran/46020] " burnus at gcc dot gnu.org
                   ` (7 more replies)
  0 siblings, 8 replies; 9+ messages in thread
From: burnus at gcc dot gnu.org @ 2010-10-14 17:08 UTC (permalink / raw)
  To: gcc-bugs

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

           Summary: Improve error string for BIND(C) diagnostic for len>1
                    character return type
           Product: gcc
           Version: 4.6.0
            Status: UNCONFIRMED
          Keywords: diagnostic
          Severity: normal
          Priority: P3
         Component: fortran
        AssignedTo: unassigned@gcc.gnu.org
        ReportedBy: burnus@gcc.gnu.org


The following is a misleading error message. The return type may be a character
string -- but only of length one!


FUNCTION F_X(A) bind(c,name='F_X')
1
Error: Return type of BIND(C) function 'f_x' at (1) cannot be a character
string

Example (taken from:
http://groups.google.com/group/comp.lang.fortran/browse_thread/thread/ee444a5894644f72#)

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


NAG prints:
  Error: BIND(C) function F_X has assumed CHARACTER length
though the error for "CHARACTER(len=4)" is also not that helpful:
  Error: BIND(C) function F_X has CHARACTER(LEN=4)


Maybe one can keep the current string and only add "with length > 1", i.e.

Error: Return type of BIND(C) function 'f_x' at (1) cannot be a character
string with length > 1


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

* [Bug fortran/46020] Improve error string for BIND(C) diagnostic for len>1 character return type
  2010-10-14 17:08 [Bug fortran/46020] New: Improve error string for BIND(C) diagnostic for len>1 character return type burnus at gcc dot gnu.org
@ 2010-10-14 17:15 ` burnus at gcc dot gnu.org
  2010-11-26  5:00 ` aoliva at gcc dot gnu.org
                   ` (6 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: burnus at gcc dot gnu.org @ 2010-10-14 17:15 UTC (permalink / raw)
  To: gcc-bugs

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


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

* [Bug fortran/46020] Improve error string for BIND(C) diagnostic for len>1 character return type
  2010-10-14 17:08 [Bug fortran/46020] New: Improve error string for BIND(C) diagnostic for len>1 character return type burnus at gcc dot gnu.org
  2010-10-14 17:15 ` [Bug fortran/46020] " burnus at gcc dot gnu.org
@ 2010-11-26  5:00 ` aoliva at gcc dot gnu.org
  2010-11-26  5:50 ` aoliva at gcc dot gnu.org
                   ` (5 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: aoliva at gcc dot gnu.org @ 2010-11-26  5:00 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #2 from Alexandre Oliva <aoliva at gcc dot gnu.org> 2010-11-26 04:25:37 UTC ---
Author: aoliva
Date: Fri Nov 26 04:25:32 2010
New Revision: 167160

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=167160
Log:
PR other/46020
* configure.ac (CXX_FOR_TARGET): Add -funconfigured-libstdc++-v3.
* Makefile.def (CXX_FOR_TARGET): Removed from flags_to_pass.
* Makefile.tpl (CXX_FOR_TARGET_FLAG_TO_PASS): New.
(BASE_FLAGS_TO_PASS): Use it.
* configure: Rebuilt.
* Makefile.in: Rebuilt.

Modified:
    trunk/ChangeLog
    trunk/Makefile.def
    trunk/Makefile.in
    trunk/Makefile.tpl
    trunk/configure
    trunk/configure.ac


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

* [Bug fortran/46020] Improve error string for BIND(C) diagnostic for len>1 character return type
  2010-10-14 17:08 [Bug fortran/46020] New: Improve error string for BIND(C) diagnostic for len>1 character return type burnus at gcc dot gnu.org
  2010-10-14 17:15 ` [Bug fortran/46020] " burnus at gcc dot gnu.org
  2010-11-26  5:00 ` 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
                   ` (4 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: aoliva at gcc dot gnu.org @ 2010-11-26  5:50 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #3 from Alexandre Oliva <aoliva at gcc dot gnu.org> 2010-11-26 04:29:45 UTC ---
Author: aoliva
Date: Fri Nov 26 04:29:41 2010
New Revision: 167163

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=167163
Log:
PR other/46020
* configure.ac (CXX_FOR_TARGET): Add -funconfigured-libstdc++-v3.
* Makefile.def (CXX_FOR_TARGET): Removed from flags_to_pass.
* Makefile.tpl (CXX_FOR_TARGET_FLAG_TO_PASS): New.
(BASE_FLAGS_TO_PASS): Use it.
* configure: Rebuilt.
* Makefile.in: Rebuilt.

Modified:
    branches/transactional-memory/ChangeLog
    branches/transactional-memory/Makefile.def
    branches/transactional-memory/Makefile.in
    branches/transactional-memory/Makefile.tpl
    branches/transactional-memory/configure
    branches/transactional-memory/configure.ac


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

* [Bug fortran/46020] Improve error string for BIND(C) diagnostic for len>1 character return type
  2010-10-14 17:08 [Bug fortran/46020] New: Improve error string for BIND(C) diagnostic for len>1 character return type burnus at gcc dot gnu.org
                   ` (2 preceding siblings ...)
  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
                   ` (3 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: aoliva at gcc dot gnu.org @ 2010-12-06 12:55 UTC (permalink / raw)
  To: gcc-bugs

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

Alexandre Oliva <aoliva at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |aoliva at gcc dot gnu.org

--- Comment #4 from Alexandre Oliva <aoliva at gcc dot gnu.org> 2010-12-06 12:55:15 UTC ---
Sorry about the spam, these check ins were meant for bug 46026.


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

* [Bug fortran/46020] Improve error string for BIND(C) diagnostic for len>1 character return type
  2010-10-14 17:08 [Bug fortran/46020] New: Improve error string for BIND(C) diagnostic for len>1 character return type burnus at gcc dot gnu.org
                   ` (3 preceding siblings ...)
  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
                   ` (2 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: aoliva at gcc dot gnu.org @ 2010-12-06 13:04 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #5 from Alexandre Oliva <aoliva at gcc dot gnu.org> 2010-12-06 13:04:11 UTC ---
Author: aoliva
Date: Mon Dec  6 13:04:07 2010
New Revision: 167491

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=167491
Log:
Check in for PR other/46020 was meant for PR other/46026.

Modified:
    branches/transactional-memory/ChangeLog


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

* [Bug fortran/46020] Improve error string for BIND(C) diagnostic for len>1 character return type
  2010-10-14 17:08 [Bug fortran/46020] New: Improve error string for BIND(C) diagnostic for len>1 character return type burnus at gcc dot gnu.org
                   ` (4 preceding siblings ...)
  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
  7 siblings, 0 replies; 9+ messages in thread
From: aoliva at gcc dot gnu.org @ 2010-12-06 13:12 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #6 from Alexandre Oliva <aoliva at gcc dot gnu.org> 2010-12-06 13:11:55 UTC ---
Author: aoliva
Date: Mon Dec  6 13:11:51 2010
New Revision: 167493

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=167493
Log:
Check in for PR other/46020 was meant for PR other/46026.

Modified:
    trunk/ChangeLog


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

* [Bug fortran/46020] Improve error string for BIND(C) diagnostic for len>1 character return type
  2010-10-14 17:08 [Bug fortran/46020] New: Improve error string for BIND(C) diagnostic for len>1 character return type burnus at gcc dot gnu.org
                   ` (5 preceding siblings ...)
  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
  7 siblings, 0 replies; 9+ messages in thread
From: burnus at gcc dot gnu.org @ 2010-12-06 13:40 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #7 from Tobias Burnus <burnus at gcc dot gnu.org> 2010-12-06 13:40:31 UTC ---
Status: Unfixed. See comment 0 for the description.


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

* [Bug fortran/46020] Improve error string for BIND(C) diagnostic for len>1 character return type
  2010-10-14 17:08 [Bug fortran/46020] New: Improve error string for BIND(C) diagnostic for len>1 character return type burnus at gcc dot gnu.org
                   ` (6 preceding siblings ...)
  2010-12-06 13:40 ` burnus at gcc dot gnu.org
@ 2014-03-22 19:43 ` dominiq at lps dot ens.fr
  7 siblings, 0 replies; 9+ messages in thread
From: dominiq at lps dot ens.fr @ 2014-03-22 19:43 UTC (permalink / raw)
  To: gcc-bugs

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

Dominique d'Humieres <dominiq at lps dot ens.fr> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
   Last reconfirmed|                            |2014-03-22
     Ever confirmed|0                           |1

--- Comment #8 from Dominique d'Humieres <dominiq at lps dot ens.fr> ---
Related to pr46496.


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

end of thread, other threads:[~2014-03-22 19:43 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-10-14 17:08 [Bug fortran/46020] New: Improve error string for BIND(C) diagnostic for len>1 character return type burnus at gcc dot gnu.org
2010-10-14 17:15 ` [Bug fortran/46020] " burnus at gcc dot gnu.org
2010-11-26  5:00 ` 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

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).