This is the mail archive of the
fortran@gcc.gnu.org
mailing list for the GNU Fortran project.
[libgfortran,committed] Fix warnings
- From: FX <fxcoudert at gmail dot com>
- To: Fortran List <fortran at gcc dot gnu dot org>, gcc-patches at gcc dot gnu dot org
- Date: Thu, 7 May 2009 23:43:55 +0200
- Subject: [libgfortran,committed] Fix warnings
I've committed the following as obvious, to fix two warnings in
libgfortran, after bootstraping and regtesting on x86_64-linux. There
are a bunch of remaining warnings, all due to the same issue with
enums (see PR22423).
2009-05-07 Francois-Xavier Coudert <fxcoudert@gcc.gnu.org>
PR fortran/22423
* io/transfer.c (read_block_direct): Avoid warning.
* runtime/string.c (compare0): Avoid warning.
Index: runtime/string.c
===================================================================
--- runtime/string.c (revision 147248)
+++ runtime/string.c (working copy)
@@ -36,7 +36,10 @@
/* Strip trailing blanks from the Fortran string. */
len = fstrlen (s1, s1_len);
- if (len != strlen(s2)) return 0; /* don't match */
+
+ if ((size_t) len != strlen(s2))
+ return 0; /* don't match */
+
return strncasecmp (s1, s2, len) == 0;
}
Index: io/transfer.c
===================================================================
--- io/transfer.c (revision 147248)
+++ io/transfer.c (working copy)
@@ -465,7 +465,7 @@
/* Check whether we exceed the total record length. */
if (dtp->u.p.current_unit->flags.has_recl
- && (nbytes > dtp->u.p.current_unit->bytes_left))
+ && ((gfc_offset) nbytes > dtp->u.p.current_unit->bytes_left))
{
to_read_record = dtp->u.p.current_unit->bytes_left;