Christopher D. Ricke - Re: [Fortran, patch] Disallow character(*) dummy arguments w (original) (raw)

This is the mail archive of the gcc-patches@gcc.gnu.orgmailing 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]

Re: [Fortran, patch] Disallow character(*) dummy arguments with VALUE attribute (PR30783)


did the fortran-experiments branch correctly handle this? Yes and no. Your check for "(*)" was correct and inspired me to check what Paul does, but you also prohibit initialization expressions with value >1 for non-C-interop variables which are allowed -- and you ignore the fact that VALUE can also be a statement: integer(c_int) :: a value :: a In this case the check in decl.c's build_sym comes too early; it should be in resolve.c's "resolve_symbol".

thanks for fixing this. i'm not surprised that it was too early; this same type of problem occured with kind validation for C interop, which is why i moved it to the end of the variable_decl().

You are right about bind(c) but for VALUE outside C interop there is no "whose value is one" restriction.

However, in my draft of the Fortran 2003 standard it is in 15.2.1. I have http://www.j3-fortran.org/doc/year/04/04-007.pdf (J3/04-007; May 10) Do you have an older version of the standard?

Actually, I don't have section 15.3.2 at all! The clause in 15.2 there is at the end of the following paragraph:

"A Fortran intrinsic type with particular type parameter values is interoperable with a C type if the type and kind type parameter value are listed in the table on the same row as that C type; if the type is character, interoperability also requires that the length type parameter be omitted or be specified by an initialization expression whose value is one."

i was looking at the 04-007 for the line numbers, but i did mess up the section number. i got the section number from a newer version.

thanks again for fixing this. Chris


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