speechd-discuss
[Top][All Lists]
Advanced

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

[PATCH] Fix most warnings with gcc 4.4 on Linux


From: Trevor Saunders
Subject: [PATCH] Fix most warnings with gcc 4.4 on Linux
Date: Tue, 7 Sep 2010 16:56:05 -0400

Hi,

On Tue, Sep 07, 2010 at 09:27:16PM +0200, Boris Dusek wrote:
> 
> On Sep 7, 2010, at 7:10 PM, Trevor Saunders wrote:
> 
> >> be the time to celebrate by turning on -Werror :-)
> > 
> > no errors is very nice, but imho werror is a pain, and should never be
> > in the production branch of a makefile.  when I'm building $random_project I
> > don't want the build to fail because of some sily warning.  Personally I 
> > just
> > run a script that runs a complete rebuild, and gets rid of normal make 
> > messages,
> > leaving only warnings, and 0 warnings makes this easier.  The issue with
> > werror is that while working on stuff you have to make sure your code
> > doesn't have silly warnings like the mixed declarations and code one.
> > At least the way I work I want to make it work correctly before I worry
> > about neatness, but that may just be me.
> 
> I gave this a bit of thought, and came to the conclusion that -Werror should
> not be present by default. -Werror can be useful to developers: on longer 
> build
> (and I consider SD's build longer), the build log is long and it's not easy to
> find warnings without an IDE. So -Werror can be useful to the developer. But 
> it

personally I have a script makewarn which basically just runs 
find .  -exec touch {}\; then make >/dev/null this updates the modifications on
all files so they will all be compiled, then runs make, but since I send
stdout to dev null only the warnings and errors get printed.

> is of no use to the "compiling user" or "packager".
> 
> I considered a scenario where we ship 0.7.1 with 0 warnings and no intention 
> to
> make 0.7.2, and then someone wants to build this software later with different
> version of gcc which introduces new warnings. This would be bad. Also 
> sometimes
> builds take place on remote machines which you can't (or it is not easy to)
> exactly reproduce (e.g. packaging build servers like Ubuntu PPA's) and
> therefore you have no other way to test your warning fix then to resubmit the
> package to the build server and pray that it finally compiles.
> 
> I also considered a case where a system header file or other 3rd-party header
> produces warning itself. In such case we would not be able to do anything 
> about
> the warning and -Werror would be fatal.

exactly.

> That said, I believe code should generally strive for 0 warnings, even if some
> of them are silly (and they are always some that are silly). But it's a price
> you pay in order to not overlook the warnings that are not silly and point at
> real bugs. Such valid warnings, in my experience, can easily get lost in other
> warnings that are silly.
> 
> So the opinion I came to is that 0 warnings is a good compromise, -Werror can
> help a developer to achieve that in their personal builds, but that -Werror
> does not belong to our Makefiles (as opposed to what I initially suggested).

agreed.

btw I'm happy to take a look into patching stuff we use that is non
portable / non posix if you don't have time.

Trev


> 
> Boris
> _______________________________________________
> Speechd mailing list
> Speechd at lists.freebsoft.org
> http://lists.freebsoft.org/mailman/listinfo/speechd
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 836 bytes
Desc: Digital signature
URL: 
<http://lists.freebsoft.org/pipermail/speechd/attachments/20100907/0667b1d5/attachment-0001.pgp>


reply via email to

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