[patch,fortran] Fix keyword check for specifiers (PR29452)
Tobias Burnus
burnus@net-b.de
Thu Oct 26 12:44:00 GMT 2006
:ADDPATCH fortran:
Hello,
this patch fixes some problems with the string comparisons for the
argument checks:
- In libgfortran, the "YES"/"NO" etc. checks where only checking whether
the first (length of fortran string) characters match. That way (Fortran
string) "N" matched (C string) "NO" etc.
- In the write/read check section of io.c, the advance argument was
compared against "YE" and "NO", thus "NOT", "YET","Yessica", etc. also
matches. As we have C strings, I replaced the str-n-casecmp( . , . , 2)
by strcasecmp.
I didn't use compare_to_allowed_values as the "not_no" is also used for
other checks (EOR and SIZE). When the missing 7 specifiers with keywords
are added, one can consider changing also this test to use
compare_to_allowed_values.
Tobias
2006-10-26 Tobias Burnus <burnus@net-b.de>
PR fortran/29452
* io.c (check_io_constraints): Fix keyword string comparison.
2006-10-26 Tobias Burnus <burnus@net-b.de>
PR fortran/29452
* runtime/string.c (compare0): Check whether string lengths match.
2006-10-26 Tobias Burnus <burnus@net-b.de>
PR fortran/29452
* gfortran.dg/write_check.f90: Check run-time keyword checking.
* gfortran.dg/write_check2.f90: Check compile-time keyword checking.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: specifier-check.diff
Type: text/x-patch
Size: 2122 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/fortran/attachments/20061026/2e4e3f3c/attachment.bin>
More information about the Fortran
mailing list