[patch, fortran, committed] Document COMPLEX*k syntax quirk.
Brooks Moses
brooks.moses@codesourcery.com
Thu Feb 22 22:25:00 GMT 2007
Brooks Moses wrote:
> Tobias Burnus wrote:
>> Well, the kind number matches the complete byte-size of the complex variable (Re+Im). I think something like:
>>
>> +/* Match an extended-f77 kind specification. This assumes that the kind
>> + number is equal to the byte size; for COMPLEX it is the total byte size
>> + of real plus imaginary part. */
>
> You're confusing "kind number" and "the integer following the '*'". The
> latter is the byte size (as the documentation now says), not the kind
> number. The kind number is the value that gets assigned to ts->kind,
> just like it is in the rest of GFortran. _That_ kind number is equal to
> half of the (total) byte size for a COMPLEX number.
>
> Does the comment need to clarify that? If so, I can try to make it clearer.
Specifically, how about:
/* Match an extended-f77 "TYPESPEC*bytesize"-style kind specification.
This assumes that the byte size is equal to the kind number for
non-COMPLEX types, and equal to twice the kind number for COMPLEX.
*/
- Brooks
More information about the Fortran
mailing list