From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from list by lists.gnu.org with archive (Exim 4.90_1) id 1kAqWr-0006Bh-Cy for mharc-grub-devel@gnu.org; Wed, 26 Aug 2020 04:11:33 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:60886) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kAqWp-000686-Ed for grub-devel@gnu.org; Wed, 26 Aug 2020 04:11:31 -0400 Received: from wout1-smtp.messagingengine.com ([64.147.123.24]:41231) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kAqWn-0005MA-NA for grub-devel@gnu.org; Wed, 26 Aug 2020 04:11:31 -0400 Received: from compute3.internal (compute3.nyi.internal [10.202.2.43]) by mailout.west.internal (Postfix) with ESMTP id 5174696B; Wed, 26 Aug 2020 04:11:28 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute3.internal (MEProxy); Wed, 26 Aug 2020 04:11:28 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=pks.im; h=date :from:to:cc:subject:message-id:references:mime-version :content-type:in-reply-to; s=fm1; bh=oAT+eq6iJPEvgGqCQe7OI3/CVw/ mk3KG/21LmsNzrts=; b=RbMcpg88BtDhDmyedRrjDo58+tlTUrUrmd7jkRIwmno SasIGnGf80rYdghKhe0oRSJwRly+0+E2loJtYxJUl0ibAv4ccnIvoBg3TjEQ5Z+m OCUCM0+f5Azxx2FfyZrffJXa3ghmYblEkozl5ZWnChSaIDhsw4r6OaH/WuAMtdbq V1Leki1hE24cmTk9aPTwLbOogItA1exnG9IYJp4GDPDYF7PDMWzfkF0XP9oOTCZy 4meRG6z2UHtKlA4SK6GdXL2bfO8A5w6ISbTx9xNSHkHVSpgfL8yQU3FoW5B00cB2 NCJxh7rXMSTCZa6Tc59gNK99Z4p3tcMJ5vfRUYAarFA== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to:x-me-proxy :x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s=fm3; bh=oAT+eq 6iJPEvgGqCQe7OI3/CVw/mk3KG/21LmsNzrts=; b=qoam1a+TCZf/hx/+ckav9b y5372aRw/O+TYI6p2AIvAB3PsTfCZ+zsQ0YZAtebeVxrLXSLTNrtkKHl2i8/Hy7V ajRnKAH2tkLxEFYAlLrxjpgXKPJ6eVs4lqt9QPibu4Xc6KuHx1RF+iGedhLvSlpK j8nfdVwomAa9Mh9CluehtiRNtFoZgzgE9oKMtPHwfRCwOj1HpAQOpaLHX8bseHwt H4+3oygFOCUm+L+7kqO1WefrHoR+iRVLgVE/bmYSHzA8fHZxge6qUuef31rkc0Qz mAO59GKUeJZu0q0pwDgr5LTbhcDyS0V5Neb5fnYbwU24DAI97vwYK39xDzGPfzMQ == X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeduiedruddvvddgtdduucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhepfffhvffukfhfgggtuggjsehgtderredttddvnecuhfhrohhmpefrrghtrhhi tghkucfuthgvihhnhhgrrhguthcuoehpshesphhkshdrihhmqeenucggtffrrghtthgvrh hnpeehgefhtdefueffheekgfffudelffejtdfhvdejkedthfehvdelgfetgfdvtedthfen ucfkphepkeelrdduvddrfeekrddvfeeinecuvehluhhsthgvrhfuihiivgepudenucfrrg hrrghmpehmrghilhhfrhhomhepphhssehpkhhsrdhimh X-ME-Proxy: Received: from vm-mail.pks.im (x590c26ec.dyn.telefonica.de [89.12.38.236]) by mail.messagingengine.com (Postfix) with ESMTPA id 2CA68328005A; Wed, 26 Aug 2020 04:11:27 -0400 (EDT) Received: from localhost (xps [10.192.0.12]) by vm-mail.pks.im (OpenSMTPD) with ESMTPSA id 53ca122b (TLSv1.3:TLS_AES_256_GCM_SHA384:256:NO); Wed, 26 Aug 2020 08:11:26 +0000 (UTC) Date: Wed, 26 Aug 2020 10:13:24 +0200 From: Patrick Steinhardt To: grub-devel@gnu.org Cc: Denis GNUtoo Carikli , Glenn Washburn , Daniel Kiper Subject: [PATCH v2 1/9] json: Remove invalid typedef redefinition Message-ID: References: MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="+QahgC5+KEYLbs62" Content-Disposition: inline In-Reply-To: Received-SPF: pass client-ip=64.147.123.24; envelope-from=ps@pks.im; helo=wout1-smtp.messagingengine.com X-detected-operating-system: by eggs.gnu.org: First seen = 2020/08/26 03:16:08 X-ACL-Warn: Detected OS = Linux 2.2.x-3.x [generic] [fuzzy] X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H4=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: grub-devel@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: The development of GNU GRUB List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 26 Aug 2020 08:11:31 -0000 --+QahgC5+KEYLbs62 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable The C standard does not allow for typedef redefinitions, even if they map to the same underlying type. In order to avoid including the "jsmn.h" in "json.h" and thus exposing jsmn's internals, we have exactly such a forward-declaring typedef in "json.h". If enforcing the GNU99 C standard, clang may generate a warning about this non-standard construct. Fix the issue by using a simple `struct jsmntok` forward declaration instead of using a typedef. Signed-off-by: Patrick Steinhardt Tested-by: Chuck Tuffli --- grub-core/lib/json/json.h | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/grub-core/lib/json/json.h b/grub-core/lib/json/json.h index 01614f6df..657902cfc 100644 --- a/grub-core/lib/json/json.h +++ b/grub-core/lib/json/json.h @@ -36,13 +36,14 @@ enum grub_json_type }; typedef enum grub_json_type grub_json_type_t; =20 -typedef struct jsmntok jsmntok_t; +/* Forward-declaration to avoid including "jsmn.h" */ +struct jsmntok; =20 struct grub_json { - jsmntok_t *tokens; - char *string; - grub_size_t idx; + struct jsmntok *tokens; + char *string; + grub_size_t idx; }; typedef struct grub_json grub_json_t; =20 --=20 2.28.0 --+QahgC5+KEYLbs62 Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAABCgAdFiEEF9hrgiFbCdvenl/rVbJhu7ckPpQFAl9GGaMACgkQVbJhu7ck PpSACg//QgNAPCPonqDc10m4Zt8RIbNVB/Nw6xM5c0aSfFTyqC1iF6pwivsoD+KH /a0n11u8cojyB5zgwy3nFR7jR0HkaDVWCVSY9BeAVayus6zXF4r809pUbHrUh0Yb /uys6uFool7F1gNRbbyZcqRC/sM5LNOLa97HAZbM/5LXXGdSF9ndjsde7KsNOuWi hUK10PSPVV67Bl8sWMgP+SFlGh01frYT0A0xt1ZYJZfqEMN2OiIkO92pwW6pxaIW FBMYmjcBvRypVgydt2ZFocIDTgW87pH+Ae4x2m1RiPwuW55p8Ut0bzOAtGY7gblv QH0ribpps2za+3XtD0lI56LzO7uqq/D5tvXWH0yv+b4b5nj/EB9Q17ny+JIshmJU mp08dX39SBf/TaJ/FVnbmtR8zZXqn/pIFB1bLFY6M4q8lbxOqumCgN0hLUHVIDZZ K/mjBb5xwfKLfMRU4COBsjMMgsofUXPFt5xOlU8A3QDa3eH1EDaVfQnMbJDXQXJC Pd+B4kTtKqAfrV6IXM5OW8u+KyGWu5qJnBoyYvHECKLIfV2HH/tPHaZJ7ZF9Okf+ gFFV4k2/KisMcwnOfFQGsKomuBnye+yk4z2ydBp4jnE5OcE4IeVnYqltKkDQH+BR nMfcHhfk44z48AgoH7nqXWJnFa/MZrVXCul+cqD8yc5Cr6aDZGE= =HKtZ -----END PGP SIGNATURE----- --+QahgC5+KEYLbs62--