Gentoo Archives: gentoo-dev

From: Richard Yao <ryao@g.o>
To: gentoo-dev@l.g.o
Subject: Re: [gentoo-dev] Changing policy about -Werror
Date: Sun, 09 Sep 2018 15:22:58
Message-Id: 79F8E956-12C7-4C96-A029-106B785294B3@gentoo.org
In Reply to: [gentoo-dev] Changing policy about -Werror by Andrew Savchenko
1 > On Sep 9, 2018, at 7:32 AM, Andrew Savchenko <bircoph@g.o> wrote:
2 >
3 > Hi!
4 >
5 > Our current -Werror policy demands unconditional removal:
6 > https://devmanual.gentoo.org/ebuild-writing/common-mistakes/index.html#-werror-compiler-flag-not-removed
7 >
8 > I think this is wrong, see bugs 665464, 665538 for a recent
9 > discussion why.
10 >
11 > My point is that in *most* cases -Werror indeed should be removed,
12 > because upstream rarely can keep up with all possible configure,
13 > *FLAGS, compiler versions and arch combinations. But! In some cases
14 > — especially for security oriented software — this flag may be
15 > pertain and may be kept at maintainer's discretion.
16 >
17 > The rationale is that -Werror usually points to dangerous
18 > situations like uninitialized variables, pointer type mismatch or
19 > implicit function declaration (and much more) which may lead to
20 > serious security implications.
21 >
22 > So, if maintainer has enough manpower to support this flag, we
23 > should allow to keep it. Of course if it will cause long-standing
24 > troubles (e.g. bugs opened for a long time) QA should have power to
25 > remove it or demand its removal.
26 >
27 > So my proposal is:
28 >
29 > 1) Deprecate QA policy with unconditional demand of -Werror removal.
30 > 2) Add to devmanual's chapter on -Werror an exception clause about
31 > security-oriented software and maintainer's right to make final
32 > decision.
33
34 -Werror has caught bugs that could have resulted in data loss in ZFS in the past thanks to it being built in userspace as part of zdb. So it is useful for integrity too, not just security (although arguably, integrity is part of security).
35
36 Currently, sys-fs/zfs turns on -Werror when USE=debug is set. So far, nobody has complained about USE=debug enforcing -Werror. USE=debug by definition ought to be an exception.
37
38 Perhaps we could have another USE flag for -Werror where it is a security feature. e.g. USE=strict-compile-checks
39 >
40 > Best regards,
41 > Andrew Savchenko

Replies

Subject Author
Re: [gentoo-dev] Changing policy about -Werror "Michał Górny" <mgorny@g.o>
Re: [gentoo-dev] Changing policy about -Werror Fabian Groffen <grobian@g.o>