From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp1 ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms11 with LMTPS id ULOVNOXPpl6BEAAA0tVLHw (envelope-from ) for ; Mon, 27 Apr 2020 12:28:21 +0000 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp1 with LMTPS id 4G3+CO7Ppl7UGQAAbx9fmQ (envelope-from ) for ; Mon, 27 Apr 2020 12:28:30 +0000 Received: from arlo.cworth.org (arlo.cworth.org [50.126.95.6]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id 9B3179401D5 for ; Mon, 27 Apr 2020 12:28:27 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by arlo.cworth.org (Postfix) with ESMTP id DCA216DE0EE7; Mon, 27 Apr 2020 05:28:20 -0700 (PDT) X-Virus-Scanned: Debian amavisd-new at cworth.org 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 bZYUOoH8n_1Y; Mon, 27 Apr 2020 05:28:20 -0700 (PDT) Received: from arlo.cworth.org (localhost [IPv6:::1]) by arlo.cworth.org (Postfix) with ESMTP id A20306DE0EF2; Mon, 27 Apr 2020 05:28:19 -0700 (PDT) Received: from localhost (localhost [127.0.0.1]) by arlo.cworth.org (Postfix) with ESMTP id 7E6BC6DE0EF2 for ; Mon, 27 Apr 2020 05:28:18 -0700 (PDT) X-Virus-Scanned: Debian amavisd-new at cworth.org 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 gMqzGwwQy_j8 for ; Mon, 27 Apr 2020 05:28:17 -0700 (PDT) Received: from fethera.tethera.net (fethera.tethera.net [198.245.60.197]) by arlo.cworth.org (Postfix) with ESMTPS id 793596DE0EE7 for ; Mon, 27 Apr 2020 05:28:17 -0700 (PDT) Received: from remotemail by fethera.tethera.net with local (Exim 4.92) (envelope-from ) id 1jT2rw-00022f-Ff; Mon, 27 Apr 2020 08:28:16 -0400 Received: (nullmailer pid 3678397 invoked by uid 1000); Mon, 27 Apr 2020 12:28:15 -0000 From: David Bremner To: notmuch@notmuchmail.org Subject: [PATCH] util/zlib-extra: de-inline gzerror_str Date: Mon, 27 Apr 2020 09:28:08 -0300 Message-Id: <20200427122808.3678351-1-david@tethera.net> X-Mailer: git-send-email 2.26.2 MIME-Version: 1.0 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: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: notmuch-bounces@notmuchmail.org Sender: "notmuch" X-Scanner: scn0 X-Spam-Score: -0.01 Authentication-Results: aspmx1.migadu.com; dkim=none; dmarc=none; spf=pass (aspmx1.migadu.com: domain of notmuch-bounces@notmuchmail.org designates 50.126.95.6 as permitted sender) smtp.mailfrom=notmuch-bounces@notmuchmail.org X-Scan-Result: default: False [-0.01 / 13.00]; ARC_NA(0.00)[]; GENERIC_REPUTATION(0.00)[-0.46220578758732]; URIBL_BLOCKED(0.00)[notmuchmail.org:email]; FROM_HAS_DN(0.00)[]; DWL_DNSWL_FAIL(0.00)[50.126.95.6:server fail]; R_SPF_ALLOW(-0.20)[+a:c]; IP_REPUTATION_HAM(0.00)[asn: 27017(-0.18), country: US(-0.00), ip: 50.126.95.6(-0.46)]; MIME_GOOD(-0.10)[text/plain]; PREVIOUSLY_DELIVERED(0.00)[notmuch@notmuchmail.org]; TO_DN_NONE(0.00)[]; HAS_LIST_UNSUB(-0.01)[]; RCPT_COUNT_ONE(0.00)[1]; DNSWL_BLOCKED(0.00)[50.126.95.6:from]; RCVD_TLS_LAST(0.00)[]; MX_GOOD(-0.50)[cached: notmuchmail.org]; FORGED_SENDER_MAILLIST(0.00)[]; MID_CONTAINS_FROM(1.00)[]; MAILLIST(-0.20)[mailman]; DMARC_NA(0.00)[tethera.net]; R_DKIM_NA(0.00)[]; MIME_TRACE(0.00)[0:+]; ASN(0.00)[asn:27017, ipnet:50.126.64.0/18, country:US]; FROM_NEQ_ENVFROM(0.00)[david@tethera.net,notmuch-bounces@notmuchmail.org]; RCVD_COUNT_SEVEN(0.00)[8] X-TUID: Q0R9L1u3LgWH It turns out the behaviour of inline functions in C header files is not a good idea, and can cause linking problems if the compiler decides not to inline them. In principle this is solvable by using a "static inline" declaration, but this potentially makes a copy in every compilation unit. Since we don't actually care about the performance of this function, just use a non-inline function. --- util/zlib-extra.c | 7 +++++++ util/zlib-extra.h | 4 ++-- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/util/zlib-extra.c b/util/zlib-extra.c index 2d2d2414..3a75e504 100644 --- a/util/zlib-extra.c +++ b/util/zlib-extra.c @@ -85,3 +85,10 @@ gz_error_string (util_status_t status, gzFile file) else return util_error_string (status); } + +const char * +gzerror_str(gzFile file) +{ + int dummy; + return gzerror (file, &dummy); +} diff --git a/util/zlib-extra.h b/util/zlib-extra.h index 296dc914..e9925c98 100644 --- a/util/zlib-extra.h +++ b/util/zlib-extra.h @@ -29,8 +29,8 @@ gz_error_string (util_status_t status, gzFile stream); /* Call gzerror with a dummy errno argument, the docs don't promise to * support the NULL case */ -inline const char * -gzerror_str(gzFile file) { int dummy; return gzerror (file, &dummy); } +const char * +gzerror_str(gzFile file); #ifdef __cplusplus } -- 2.26.2