From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from localhost (localhost [127.0.0.1]) by arlo.cworth.org (Postfix) with ESMTP id 192556DE0EA8 for ; Sat, 2 Mar 2019 10:34:23 -0800 (PST) X-Virus-Scanned: Debian amavisd-new at cworth.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=[AWL=-0.009, SPF_PASS=-0.001] autolearn=disabled Received: from arlo.cworth.org ([127.0.0.1]) by localhost (arlo.cworth.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id rGCGF20fbztj for ; Sat, 2 Mar 2019 10:34:22 -0800 (PST) Received: from fethera.tethera.net (fethera.tethera.net [198.245.60.197]) by arlo.cworth.org (Postfix) with ESMTPS id ECEB46DE0C7A for ; Sat, 2 Mar 2019 10:34:21 -0800 (PST) Received: from remotemail by fethera.tethera.net with local (Exim 4.89) (envelope-from ) id 1h09Sl-0004ZT-6u; Sat, 02 Mar 2019 13:34:19 -0500 Received: (nullmailer pid 6899 invoked by uid 1000); Sat, 02 Mar 2019 18:34:18 -0000 From: David Bremner To: notmuch@notmuchmail.org Subject: [PATCH] lib/string_map: fix return type of string_cmp Date: Sat, 2 Mar 2019 14:34:12 -0400 Message-Id: <20190302183412.6822-1-david@tethera.net> X-Mailer: git-send-email 2.20.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-BeenThere: notmuch@notmuchmail.org X-Mailman-Version: 2.1.29 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: Sat, 02 Mar 2019 18:34:23 -0000 I can't figure out how checking the sign of a bool ever worked. The following program demonstrates the problem (i.e. for me it prints 1). #include #include int main(int argc, char **argv) { bool x; x = -1; printf("x = %d\n", x); } This seems to be mandated by the C99 standard 6.3.1.2. --- I'd like to get this in a new point release ASAP. lib/string-map.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/string-map.c b/lib/string-map.c index ad818207..a88404c7 100644 --- a/lib/string-map.c +++ b/lib/string-map.c @@ -106,7 +106,7 @@ _notmuch_string_map_sort (notmuch_string_map_t *map) map->sorted = true; } -static bool +static int string_cmp (const char *a, const char *b, bool exact) { if (exact) -- 2.20.1