PATCH: fix comparison bug in gcc.c

Ben Elliston bje@au1.ibm.com
Wed Jul 13 15:41:00 GMT 2005


I investigated a warning which led me to this bug, which crept in yesterday.
Okay for mainline?

2005-07-13  Ben Elliston  <bje@au.ibm.com>

       * gcc.c (main): Compare language[0] with '*' when iterating over
       the infiles.

Index: gcc.c
===================================================================
RCS file: /home/bje/gcc-cvs/gcc/gcc/gcc.c,v
retrieving revision 1.465
diff -u -p -r1.465 gcc.c
--- gcc.c       12 Jul 2005 18:10:32 -0000      1.465
+++ gcc.c       13 Jul 2005 05:20:28 -0000
@@ -6569,7 +6569,7 @@ main (int argc, const char **argv)
       int i;

       for (i = 0; i < n_infiles ; i++)
-       if (infiles[i].language && infiles[i].language != '*')
+       if (infiles[i].language && infiles[i].language[0] != '*')
          {
            set_input (infiles[i].name);
            break;
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 256 bytes
Desc: OpenPGP digital signature
URL: <http://gcc.gnu.org/pipermail/gcc-patches/attachments/20050713/70050628/attachment.sig>


More information about the Gcc-patches mailing list