Re: database error
[notmuch-archives.git] / 82 / 08333b3b07b1d63c4634ddac4dcc170e451a6a
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 7656F429E25\r
6         for <notmuch@notmuchmail.org>; Tue, 21 Jun 2011 14:59:06 -0700 (PDT)\r
7 X-Virus-Scanned: Debian amavisd-new at olra.theworths.org\r
8 X-Spam-Flag: NO\r
9 X-Spam-Score: 0.01\r
10 X-Spam-Level: \r
11 X-Spam-Status: No, score=0.01 tagged_above=-999 required=5\r
12         tests=[T_MIME_NO_TEXT=0.01] autolearn=disabled\r
13 Received: from olra.theworths.org ([127.0.0.1])\r
14         by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024)\r
15         with ESMTP id ucqo2mW4n6FO for <notmuch@notmuchmail.org>;\r
16         Tue, 21 Jun 2011 14:59:05 -0700 (PDT)\r
17 Received: from arlo.cworth.org (arlo.cworth.org [50.43.72.2])\r
18         by olra.theworths.org (Postfix) with ESMTP id AD68A431FB6\r
19         for <notmuch@notmuchmail.org>; Tue, 21 Jun 2011 14:59:05 -0700 (PDT)\r
20 Received: from yoom.home.cworth.org (localhost [127.0.0.1])\r
21         by arlo.cworth.org (Postfix) with ESMTP id 865DC29A4F5;\r
22         Tue, 21 Jun 2011 14:59:04 -0700 (PDT)\r
23 Received: by yoom.home.cworth.org (Postfix, from userid 1000)\r
24         id 76050254157; Tue, 21 Jun 2011 14:59:04 -0700 (PDT)\r
25 From: Carl Worth <cworth@cworth.org>\r
26 To: Dmitry Kurochkin <dmitry.kurochkin@gmail.com>, notmuch@notmuchmail.org\r
27 Subject: Re: [PATCH] Fix compilation warnings in test/smtp-dummy.c.\r
28 In-Reply-To: <1308220328-17995-1-git-send-email-dmitry.kurochkin@gmail.com>\r
29 References: <1308220328-17995-1-git-send-email-dmitry.kurochkin@gmail.com>\r
30 User-Agent: Notmuch/0.5 (http://notmuchmail.org) Emacs/23.3.1\r
31         (i486-pc-linux-gnu)\r
32 Date: Tue, 21 Jun 2011 14:59:04 -0700\r
33 Message-ID: <87r56methz.fsf@yoom.home.cworth.org>\r
34 MIME-Version: 1.0\r
35 Content-Type: multipart/signed; boundary="=-=-=";\r
36         micalg=pgp-sha1; protocol="application/pgp-signature"\r
37 X-BeenThere: notmuch@notmuchmail.org\r
38 X-Mailman-Version: 2.1.13\r
39 Precedence: list\r
40 List-Id: "Use and development of the notmuch mail system."\r
41         <notmuch.notmuchmail.org>\r
42 List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,\r
43         <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>\r
44 List-Archive: <http://notmuchmail.org/pipermail/notmuch>\r
45 List-Post: <mailto:notmuch@notmuchmail.org>\r
46 List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>\r
47 List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,\r
48         <mailto:notmuch-request@notmuchmail.org?subject=subscribe>\r
49 X-List-Received-Date: Tue, 21 Jun 2011 21:59:06 -0000\r
50 \r
51 --=-=-=\r
52 Content-Transfer-Encoding: quoted-printable\r
53 \r
54 On Thu, 16 Jun 2011 14:32:08 +0400, Dmitry Kurochkin <dmitry.kurochkin@gmai=\r
55 l.com> wrote:\r
56 > * Remove unused variables in main(): buf, bytes and greeting.\r
57 > * Replace return with no value in main() with exit(3).\r
58 \r
59 Thanks. I'd notice these occasionally when running the test suite and\r
60 had meant for some time to fix them. But when doing my typical\r
61 compilation within emacs, (with just "make"), I wouldn't get these\r
62 warnings so I wasn't cleaning these in my typical work to make the\r
63 compilation error/warning-free.\r
64 \r
65 I did follow up with a commit to prefer return (with a value) over\r
66 exit(), which I applied throughout the main() function:\r
67 \r
68 commit b1aa676cca01ce0d907d220dc3c3a5142991c1cf\r
69 Author: Carl Worth <cworth@cworth.org>\r
70 Date:   Tue Jun 21 14:54:10 2011 -0700\r
71 \r
72     smtp-dummy: Prefer return rather than exit() in main.\r
73 =20=20=20=20\r
74     The main() function should be written as just another function with a\r
75     return value. This allows for more reliable code reuse. Imagine that\r
76     main() grows too large and needs to be factored into multiple\r
77     functions. At that point, exit() is probably the wrong thing, yet can\r
78     also be hard to notice as it's in less-frequently-tested exceptional\r
79     cases.\r
80 \r
81 \r
82 =2DCarl\r
83 \r
84 =2D-=20\r
85 carl.d.worth@intel.com\r
86 \r
87 --=-=-=\r
88 Content-Type: application/pgp-signature\r
89 \r
90 -----BEGIN PGP SIGNATURE-----\r
91 Version: GnuPG v1.4.11 (GNU/Linux)\r
92 \r
93 iEYEARECAAYFAk4BFCgACgkQ6JDdNq8qSWjy3gCfdMiie3o2ug5hSzOjK11+1K2j\r
94 iS4An33XAc/HV/MWqxmsB3CXai6e/zZX\r
95 =KkGl\r
96 -----END PGP SIGNATURE-----\r
97 --=-=-=--\r