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/46020] Improve error string for BIND(C) diagnostic for len>1 character return type


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


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