bug-gnu-utils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: libintl.h warnings with -Wundef


From: Bruno Haible
Subject: Re: libintl.h warnings with -Wundef
Date: Sat, 20 Sep 2008 03:19:53 +0200
User-agent: KMail/1.5.4

Marc Espie (with OpenBSD fame) wrote:
> > So I don't see a reason to do particular efforts for the sake of this 
> > warning.
> 
> How about if we give you a correct patch for it ?

Even if you give a patch for it, I will not apply it. Because it is pointless.

> I really don't see any downside to it. Prove to me otherwise.

No, it is the other way around: You have to prove that -Wundef is useful.

> > Btw, you can get rid of the warning also by using the gcc command line
> > option "-isystem /usr/local/include" instead of "-I /usr/local/include".
> 
> That's assuming there are only nice headers under /usr/local/include, which is
> not at all the case in the case at hand...

The user is building a package of his own, and is not interested in warnings
from headers in /usr/local/include, because they are not part of his package.
Therefore -isystem is appropriate here. Whether some headers would give more
and others would give less warnings otherwise, is irrelevant.

> This is just a pain in the ass... compiling thousands of software projects is
> not that easy. Each stupid warning is noise.

So, why do I get warnings like
  warning: strcpy() is almost always misused, please use strlcpy()
  warning: sprintf() is often misused, please use snprintf()
each time I link a program on OpenBSD? My programs are written in GNU style,
with dynamic memory allocation instead of buffers of fixed and arbitrary size.
Therefore when I use strcpy or sprintf I _do_ care about not overflowing the
destination area. Therefore these warnings are pointless to me.

> Disabling those warnings means
> tinkering with hundreds of makefiles, if you're lucky, or tinkering with
> hundreds of autoconf/automake configurations

I understand your point. You can either patch the installed libintl.h
in OpenBSD, or patch your gcc so that it treats "-I /usr/local/include" like
"-isystem /usr/local/include" automatically, or patch your gcc so that
the warnings that you consider useless have no effect.

Bruno





reply via email to

[Prev in Thread] Current Thread [Next in Thread]