[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 15:13:02 -0400 |
Hi,
On Tue, Sep 07, 2010 at 12:53:32PM -0500, William Hubbs wrote:
> On Tue, Sep 07, 2010 at 01:10:37PM -0400, Trevor Saunders wrote:
> > 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 couldn't disagree more. If you pay attention to warnings, you aren't
> only worrying about neatness, but cleaning up code that could cause
> problems for you further down the road. If you clean all of that up
> before you commit it to the tree, you are saving the rest of the team
> from dealing with issues later on.
true, I'm not a terribly careful person :(
But I think you mis interpreted me there, I completely agree warnings
should be fixed before going upstream, I don't think I've ever sent
someone a patch that added warnings. What I meant is that if I am
working on a patch it is easier sometimes to leave the warning fixing
part to later in the patch creation. So the warnings are fixed in the
final patch, but initial builds with warnings are fine, even local
commits that get squashed later with warnings is fine.
So as an example of what I'm saying here a precommit hook on the master
tree that does
CFLAGS="-werror" make
is fine with me, but CFLAGS in the makefile shouldn't happen and before
you push the patch up stream its fine to have builds ucced with
warnings. I hope that's clearer.
> I think that production quality code should be error and warning free if
> possible, and I do not see any reason this can't be possible.
agreed, so make in master should be able to work with werror.
However this isn't a perfect world, and lots of packages do build with
warnings, and weird things could happen. I suspect in practice you'd
rather have emerge succeed and tell you about warnings rather than just
die with things halfway installed.
What I mean is this warnings are useful, but if a user tries to build
something that uses werror in CFLAGS and there is a warning for
whatever reason the user now has to hit the makefile with some sed to
get rid of werror so they can go on with their life. How does that
help the user?
Trev
>
> William
>
> _______________________________________________
> 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/0892e091/attachment.pgp>
[PATCH] Fix most warnings with gcc 4.4 on Linux, Christopher Brannon, 2010/09/07
[PATCH] Fix most warnings with gcc 4.4 on Linux, Andrei Kholodnyi, 2010/09/08