Re: [notmuch] [PATCH 1/2] * avoid gcc 4.4.1 compiler warnings due to ignored write...
authorCarl Worth <cworth@cworth.org>
Tue, 1 Dec 2009 15:57:30 +0000 (07:57 +1600)
committerW. Trevor King <wking@tremily.us>
Fri, 7 Nov 2014 17:35:48 +0000 (09:35 -0800)
ed/39e42e815fab52ccfb82a0f975ced8e0296d2d [new file with mode: 0644]

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