This is the mail archive of the fortran@gcc.gnu.org mailing list for the GNU Fortran 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]

Re: [PATCH,fortran] fix iso_c_binding only clause bug




On Thu, 5 Jul 2007, Brooks Moses wrote:

Christopher D. Rickett wrote:
hi Tobias,
This is something which should be rejected for -std=f2003; it should be
easy using "gfc_notify_std (GFC_STD_F2003, ..." I think one can allow it
by default, but I don't mind always rejecting it.Note: using "call foo("abcdef"//C_CHAR_NULL)" works with
"character(len=0),dimension(*)" per F2003 standard, which is implemented
in gfortran. Thus prohibiting it completely would also be ok.

i agree that this should be an error w/ -std=f2003, but having it error for std=gnu or by default seems harsh to me. i know of at least one other compiler that allows it. if acceptable, i'll add the std=f2003
check for the error.

In particular, if we do allow other character lengths in bind(c) procedures, what happens if we then try to call them from a C program? Do they actually work correctly? What if we have a length other than one and a character _array_ -- what happens then? What if it's an assumed-shape array? What if it's an assumed-shape array of assumed length?



you raise some good points and i think calling from C would definitely be a problem. completely rejecting it now seems the only safe way to go.


Chris


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