Warning elimination patches.

Jeffrey A Law law@cygnus.com
Sat Feb 7 23:08:00 GMT 1998


  In message < 19980206005230.23950@dgii.com >you write:
  > I just wanted Kaveh to know he wasn't alone and his work was
  > appreciated. :-) So I knocked off a couple hundred warnings.
The work is *greatly* appreciated.  Bruno Haible has also sent in a lot
of warnings fixed, but we're waiting on an assignment before we can
start installing them.

It's not particularly exciting work, but I think the long term payoff will
make it worth it.

  > Yes, I know that the rules say to submit one change per patch and one
  > patch per email.  If that's really the rule, I'll gladly obey.  I
  > suspect that for relatively brainless patches like this, it would
  > actually be harder to grok.   
I've been kinda lax in that regard for these patches.  Most of them are
trivial to understand.


  > I did an update just before going through this exercise, so I think
  > they should drop in cleanly.
They did.

  > I didn't go for zero warnings in every file I touched.  I went for
  > the really easy ones that were self-evident.  For example, on this
  > pass to prove a variable really was unused, an editor search had to
  > not find it within scope.  So things hidden in preprocessing action
  > or named "i" or "n" didn't get touched this time.
Yup.  That sounds like the right approach to me.

As Kaveh mentioned, the right way for string/strings is:

#ifdef HAVE_STRING_H
#include <string.h>
#else
#ifdef HAVE_STRINGS_H
#include <strings.h>
#endif
#endif

This was necessary to make some system (I don't remember which) happy.
I fixed this in all the necessary places and installed your patch.




More information about the Gcc mailing list