Patch: fix gcc warnings
Sam Varshavchik <[email protected]> Wed, 04 Jan 2006 21:48:20 -0500
| Newsgroups | gmane.comp.lib.libwww |
|---|---|
| Message-ID | <[email protected]> |
This is a MIME GnuPG-signed message. If you see this text, it means that
your E-mail or Usenet software does not support MIME signed messages.
The Internet standard for MIME PGP messages, RFC 2015, was published in 1996.
To open this message correctly you will need to install E-mail or Usenet
software that supports modern Internet standards.
--=_mimegpg-commodore.email-scan.com-6969-1136429300-0006
Content-Type: text/plain; format=flowed; charset="US-ASCII"
Content-Disposition: inline
Content-Transfer-Encoding: 7bit
gcc is smart enough to figure out that HTAssoc_name() may potentially return
a NULL, which is a no-no argument to strcmp().
Unfortunately, gcc isn't smart enough to figure out that the NULL codepath
can never occur, and optimize it away. Instead, it whines no less than a
dozen times, in a row.
Index: Library/src/HTAssoc.c
===================================================================
RCS file: /cvsroot/lpmtool/libwww/Library/src/HTAssoc.c,v
retrieving revision 1.1.1.1
diff -U3 -r1.1.1.1 HTAssoc.c
--- Library/src/HTAssoc.c 5 Jan 2006 01:08:49 -0000 1.1.1.1
+++ Library/src/HTAssoc.c 5 Jan 2006 02:46:16 -0000
@@ -129,7 +129,7 @@
HTAssocList * cur = list;
HTAssoc * assoc;
while ((assoc = (HTAssoc *) HTAssocList_nextObject(cur))) {
- if (!strcmp(HTAssoc_name(assoc), name))
+ if (!strcmp(assoc->name, name))
return HTAssoc_value(assoc);
}
}
--=_mimegpg-commodore.email-scan.com-6969-1136429300-0006
Content-Type: application/pgp-signature
Content-Transfer-Encoding: 7bit
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.7 (GNU/Linux)
iD8DBQBDvIj0x9p3GYHlUOIRAuKHAJ0Y2AcbRnq7yj+jrWHf2gP2JxP4UACfXO9C
IVbkrQ35IgssCfMfpcpC8uM=
=/0K0
-----END PGP SIGNATURE-----
--=_mimegpg-commodore.email-scan.com-6969-1136429300-0006--