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)
- From: "Christopher D. Rickett"
- To: "Tobias Burnus"
- Cc: fortran at gcc dot gnu dot org, gcc-patches at gcc dot gnu dot org
- Date: Wed, 14 Feb 2007 10:55:10 -0700 (MST)
- Subject: Re: [Fortran, patch] Disallow character(*) dummy arguments with VALUE attribute (PR30783)
- References: <45D2CDA1.8060904@net-b.de> <45D2D4A2.5070204@codesourcery.com> <21357.128.165.0.81.1171469857.squirrel@webmail.lanl.gov> <45D3426E.2070807@net-b.de>
- Reply-to: crickett at lanl dot gov
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
- References:
- [Fortran, patch] Disallow character(*) dummy arguments with VALUE attribute (PR30783)
* From: Tobias Burnus - Re: [Fortran, patch] Disallow character(*) dummy arguments with VALUE attribute (PR30783)
* From: Brooks Moses - Re: [Fortran, patch] Disallow character(*) dummy arguments with VALUE attribute (PR30783)
* From: Christopher D. Rickett - Re: [Fortran, patch] Disallow character(*) dummy arguments with VALUE attribute (PR30783)
* From: Tobias Burnus
- [Fortran, patch] Disallow character(*) dummy arguments with VALUE attribute (PR30783)
Index Nav: | [Date Index] [Subject Index] [Author Index] [Thread Index] | |
---|---|---|
Message Nav: | [Date Prev] [Date Next] | [Thread Prev] [Thread Next] |