1 Return-Path: <cworth@cworth.org>
\r
2 X-Original-To: notmuch@notmuchmail.org
\r
3 Delivered-To: notmuch@notmuchmail.org
\r
4 Received: from localhost (localhost [127.0.0.1])
\r
5 by olra.theworths.org (Postfix) with ESMTP id D234D431FBC;
\r
6 Tue, 1 Dec 2009 07:58:12 -0800 (PST)
\r
7 X-Virus-Scanned: Debian amavisd-new at olra.theworths.org
\r
8 Received: from olra.theworths.org ([127.0.0.1])
\r
9 by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024)
\r
10 with ESMTP id Cv+35ZUvBVks; Tue, 1 Dec 2009 07:58:11 -0800 (PST)
\r
11 Received: from yoom.home.cworth.org (localhost [127.0.0.1])
\r
12 by olra.theworths.org (Postfix) with ESMTP id D2091431FAE;
\r
13 Tue, 1 Dec 2009 07:58:11 -0800 (PST)
\r
14 Received: by yoom.home.cworth.org (Postfix, from userid 1000)
\r
15 id 0CDA9254419; Tue, 1 Dec 2009 07:57:54 -0800 (PST)
\r
16 From: Carl Worth <cworth@cworth.org>
\r
17 To: Jed Brown <jed@59A2.org>, Karl Wiberg <kha@treskal.com>,
\r
18 Dirk-Jan Binnema <djcb.bulk@gmail.com>
\r
19 In-Reply-To: <87ws1h48up.fsf@59A2.org>
\r
20 References: <87skc5yd6v.wl%djcb@djcbsoftware.nl>
\r
21 <b8197bcb0911222334v26e96890t3632369ff32ff80f@mail.gmail.com>
\r
22 <1873022c0911230311o77e55fdqa5464a2dd16ec265@mail.gmail.com>
\r
23 <b8197bcb0911230519l4edf1b72w26d993834f25a417@mail.gmail.com>
\r
24 <87ws1h48up.fsf@59A2.org>
\r
25 Date: Tue, 01 Dec 2009 07:57:30 -0800
\r
26 Message-ID: <87ljhmadqt.fsf@yoom.home.cworth.org>
\r
28 Content-Type: multipart/signed; boundary="=-=-=";
\r
29 micalg=pgp-sha1; protocol="application/pgp-signature"
\r
30 Cc: "notmuch@notmuchmail org" <notmuch@notmuchmail.org>, djcb@djcbsoftware.nl
\r
31 Subject: Re: [notmuch] [PATCH 1/2] * avoid gcc 4.4.1 compiler warnings due
\r
32 to ignored write return values
\r
33 X-BeenThere: notmuch@notmuchmail.org
\r
34 X-Mailman-Version: 2.1.12
\r
36 List-Id: "Use and development of the notmuch mail system."
\r
37 <notmuch.notmuchmail.org>
\r
38 List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,
\r
39 <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>
\r
40 List-Archive: <http://notmuchmail.org/pipermail/notmuch>
\r
41 List-Post: <mailto:notmuch@notmuchmail.org>
\r
42 List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>
\r
43 List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,
\r
44 <mailto:notmuch-request@notmuchmail.org?subject=subscribe>
\r
45 X-List-Received-Date: Tue, 01 Dec 2009 15:58:13 -0000
\r
48 Content-Transfer-Encoding: quoted-printable
\r
50 On Mon, 23 Nov 2009 15:24:46 +0100, Jed Brown <jed@59A2.org> wrote:
\r
51 > >From the gcc man page:
\r
54 > Warn whenever a statement computes a result that is explicitly
\r
55 > not used. To suppress this warning cast the unused expression
\r
56 > to void. This includes an expression-statement or the left-
\r
57 > hand side of a comma expression that contains no side effects.
\r
58 > For example, an expression such as x[i,j] will cause a
\r
59 > warning, while x[(void)i,j] will not.
\r
61 > This warning is enabled by -Wall.
\r
63 > But I'm confused here because I don't currently see any warnings with
\r
64 > gcc-4.4.2. Actually this must be a bug because I get no warnings for
\r
65 > the blatantly unused
\r
69 I'm guessing that the -Wunused-value warning doesn't consider values
\r
70 computed by function calls.
\r
72 > with -Wall -Wextra -pedantic. Anyway, if your system headers specify
\r
73 > __attribute__((warn_unused_result)) for write, then you could be running
\r
74 > into this bug/feature
\r
76 > http://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D35579
\r
78 Yes, this is the attribute that's triggering the warnings. I poked
\r
79 around in the glibc headers to see how to get this warning myself, and I
\r
82 make CFLAGS=3D"-O -D_FORTIFY_SOURCE"
\r
84 That makes the warning appear even with gcc 4.3.4, (and the definitions
\r
85 in the headers suggest it will work with any gcc >=3D 4.1).
\r
87 So I've pushed the patch now, (with an updated commit message to reflect
\r
88 the above analysis).
\r
93 Content-Type: application/pgp-signature
\r
95 -----BEGIN PGP SIGNATURE-----
\r
96 Version: GnuPG v1.4.10 (GNU/Linux)
\r
98 iD8DBQFLFTzr6JDdNq8qSWgRAmTkAJ9qjycQrHDuRLq54x4bGTM8Z+H34gCdEZz8
\r
99 sK/IlLyJPop5emQ8MFAYoe8=
\r
101 -----END PGP SIGNATURE-----
\r