Return-Path: X-Original-To: notmuch@notmuchmail.org Delivered-To: notmuch@notmuchmail.org Received: from localhost (localhost [127.0.0.1]) by olra.theworths.org (Postfix) with ESMTP id 4E260431FD0 for ; Fri, 3 Jun 2011 12:24:36 -0700 (PDT) X-Virus-Scanned: Debian amavisd-new at olra.theworths.org X-Spam-Flag: NO X-Spam-Score: 0.01 X-Spam-Level: X-Spam-Status: No, score=0.01 tagged_above=-999 required=5 tests=[T_MIME_NO_TEXT=0.01] autolearn=disabled Received: from olra.theworths.org ([127.0.0.1]) by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 6KmkHRVIojxm for ; Fri, 3 Jun 2011 12:24:35 -0700 (PDT) Received: from arlo.cworth.org (arlo.cworth.org [50.43.72.2]) by olra.theworths.org (Postfix) with ESMTP id 8CCEA431FB6 for ; Fri, 3 Jun 2011 12:24:35 -0700 (PDT) Received: from yoom.home.cworth.org (localhost [127.0.0.1]) by arlo.cworth.org (Postfix) with ESMTP id 401D829A5CC; Fri, 3 Jun 2011 12:24:34 -0700 (PDT) Received: by yoom.home.cworth.org (Postfix, from userid 1000) id 2F62225417E; Fri, 3 Jun 2011 12:24:34 -0700 (PDT) From: Carl Worth To: Jameson Graef Rollins , Notmuch Mail Subject: Re: [PATCH 17/25] avoid segfault when calling sanitize_string() on NULL In-Reply-To: <1306619520-25730-18-git-send-email-jrollins@finestructure.net> References: <1306619520-25730-1-git-send-email-jrollins@finestructure.net> <1306619520-25730-2-git-send-email-jrollins@finestructure.net> <1306619520-25730-3-git-send-email-jrollins@finestructure.net> <1306619520-25730-4-git-send-email-jrollins@finestructure.net> <1306619520-25730-5-git-send-email-jrollins@finestructure.net> <1306619520-25730-6-git-send-email-jrollins@finestructure.net> <1306619520-25730-7-git-send-email-jrollins@finestructure.net> <1306619520-25730-8-git-send-email-jrollins@finestructure.net> <1306619520-25730-9-git-send-email-jrollins@finestructure.net> <1306619520-25730-10-git-send-email-jrollins@finestructure.net> <1306619520-25730-11-git-send-email-jrollins@finestructure.net> <1306619520-25730-12-git-send-email-jrollins@finestructure.net> <1306619520-25730-13-git-send-email-jrollins@finestructure.net> <1306619520-25730-14-git-send-email-jrollins@finestructure.net> <1306619520-25730-15-git-send-email-jrollins@finestructure.net> <1306619520-25730-16-git-se nd-email-jrollins@finestructure.net> <1306619520-25730-17-git-send-email-jrollins@finestructure.net> <1306619520-25730-18-git-send-email-jrollins@finestructure.net> User-Agent: Notmuch/0.5 (http://notmuchmail.org) Emacs/23.3.1 (i486-pc-linux-gnu) Date: Fri, 03 Jun 2011 12:24:23 -0700 Message-ID: <87vcwmlnvc.fsf@yoom.home.cworth.org> MIME-Version: 1.0 Content-Type: multipart/signed; boundary="=-=-="; micalg=pgp-sha1; protocol="application/pgp-signature" Cc: Daniel Kahn Gillmor X-BeenThere: notmuch@notmuchmail.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: "Use and development of the notmuch mail system." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 03 Jun 2011 19:24:36 -0000 --=-=-= On Sat, 28 May 2011 14:51:52 -0700, Jameson Graef Rollins wrote: > + if (NULL == str) > + return NULL; I haven't been blocking patches because of this, but can I please ask everyone to not use the above style? I understand that the above style is intended to generate a compiler error in the case of the programmer mistyping '=' where '==' was intended. But I just can't stand this style. It looks so unnatural to me to read "if some_value is some_variable" instead of the natural "if some_variable is some_value". Also, gcc is kind enough to warn ("suggest parentheses around assignment used as truth value") in the case of "if (str = NULL)" anyway, so there's no actual benefit to the unnatural style. I really do want our code to be readable, and I think that little things do make a difference. Thanks for your attention, (and thanks for your patience if I seem off my rocker). -Carl --=-=-= Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.11 (GNU/Linux) iEYEARECAAYFAk3pNOcACgkQ6JDdNq8qSWhinACaA5eII2UPeFmC3inHcHtqgvfd ynYAmwbQGgZP67LjDt7JKrYUjEbJWEaQ =4kut -----END PGP SIGNATURE----- --=-=-=--