[patch,fortran] Fix keyword check for specifiers (PR29452)

Tobias Burnus burnus@net-b.de
Fri Oct 27 11:18:00 GMT 2006


Hi,

I also fixed here the dg-error pattern matching.

Tobias Burnus wrote:
> 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.
>   

Build (make distclean; ...; make) & "make -k check" tested on
x86_64-unknown-linux-gnu
(Only FAILs are in gcc.c-torture/execute/mayalias-2.c (ICE) and
gcc.dg/tree-ssa/loadpre1*.c
and the XPASSes for gfortran.dg/csqrt_2.f)

Tobias
-------------- next part --------------
A non-text attachment was scrubbed...
Name: specifier-check-2.diff
Type: text/x-patch
Size: 2271 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/gcc-patches/attachments/20061027/cca3b657/attachment.bin>


More information about the Gcc-patches mailing list