From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from list by lists.gnu.org with archive (Exim 4.90_1) id 1kFJ3Y-0003Ec-3p for mharc-grub-devel@gnu.org; Mon, 07 Sep 2020 11:27:44 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:60036) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kFJ3U-0003Bs-Aw for grub-devel@gnu.org; Mon, 07 Sep 2020 11:27:40 -0400 Received: from wout2-smtp.messagingengine.com ([64.147.123.25]:51695) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kFJ3Q-0007CG-00 for grub-devel@gnu.org; Mon, 07 Sep 2020 11:27:39 -0400 Received: from compute3.internal (compute3.nyi.internal [10.202.2.43]) by mailout.west.internal (Postfix) with ESMTP id A771A4ED; Mon, 7 Sep 2020 11:27:34 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute3.internal (MEProxy); Mon, 07 Sep 2020 11:27:34 -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=fm2; bh=QKQjlUIQnusek4uVeDCb73cTuPZ JfCg+Q1/i6Vy3tKs=; b=DCCE1vX27Ju54MEZfPWn0Dyow2blK8wHXHWPPRlfnUR 4cZf8bGnFK5lWQWh+yMoJG/iTf/gdhy2CYPIHxLkU3aGEHlE1hDJ/wZwFEThgjA+ O3WHumLh8riNQ0Tl/O9mGYKg7Z3OD6CtJkM2LnhKVsSR6D6pf/3P79dCeadsgUWL 4r92C08Yxy68NrRVAgDU9IuscJpkJ469cE/xfVZNnYkfUxzkwzCPkHkv0WFNH5/B Uk+JELZ9tQ88nrFUxwsKMbAxKAhF/B4Z2qTbB8Scsl05krgaNA87DBGII8tRNdjK OeEQEXpSsT2XAL/Syj6coVq4rCFubIB2QeH1t5Jv9zA== 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=QKQjlU IQnusek4uVeDCb73cTuPZJfCg+Q1/i6Vy3tKs=; b=CdMdwqn1Obln9QlmtfraI8 +q+ucCnEIWUecuGTSfbHg12H/cWmRJRYirpCc2cxk7JbyhLnX254UY40Bdnog3PK hCBZsd9YiJOY5wJXKXl9UOl1RTPSxAEOiQOBQAkL5Zxt8eHtm0JpjEGXEakXuMTp R/dHdFSiXWuKqtmhGnsCyQduTdkCWsqFgpQ9HfNUVNVFPdKdk71u2t13NzvbX57y MC0G8rOH1LiEc0BdjHo0Q+7FRqUgsZb7dFBZkNpEkOYhJZjuyZKJGUW8/racyov1 lTHAvBg64tO/713jB0AcebgthPixSoeMcM4Zp/B/1ykBszoTr3TXn54BtZJwvjuA == X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeduiedrudehtddgledtucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhepfffhvffukfhfgggtuggjsehgtderredttddvnecuhfhrohhmpefrrghtrhhi tghkucfuthgvihhnhhgrrhguthcuoehpshesphhkshdrihhmqeenucggtffrrghtthgvrh hnpeehgefhtdefueffheekgfffudelffejtdfhvdejkedthfehvdelgfetgfdvtedthfen ucfkphepkeelrddugedrfeekrddufeegnecuvehluhhsthgvrhfuihiivgepudenucfrrg hrrghmpehmrghilhhfrhhomhepphhssehpkhhsrdhimh X-ME-Proxy: Received: from vm-mail.pks.im (x590e2686.dyn.telefonica.de [89.14.38.134]) by mail.messagingengine.com (Postfix) with ESMTPA id 842303280069; Mon, 7 Sep 2020 11:27:33 -0400 (EDT) Received: from localhost (tanuki [10.192.0.23]) by vm-mail.pks.im (OpenSMTPD) with ESMTPSA id db3d9238 (TLSv1.3:TLS_AES_256_GCM_SHA384:256:NO); Mon, 7 Sep 2020 15:27:33 +0000 (UTC) Date: Mon, 7 Sep 2020 17:27:32 +0200 From: Patrick Steinhardt To: grub-devel@gnu.org Cc: Denis GNUtoo Carikli , Glenn Washburn , Daniel Kiper Subject: [PATCH v3 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="UlVJffcvxoiEqYs2" Content-Disposition: inline In-Reply-To: Received-SPF: pass client-ip=64.147.123.25; envelope-from=ps@pks.im; helo=wout2-smtp.messagingengine.com X-detected-operating-system: by eggs.gnu.org: First seen = 2020/09/07 11:26:12 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_H3=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: Mon, 07 Sep 2020 15:27:41 -0000 --UlVJffcvxoiEqYs2 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 --UlVJffcvxoiEqYs2 Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAABCgAdFiEEF9hrgiFbCdvenl/rVbJhu7ckPpQFAl9WUWMACgkQVbJhu7ck PpRBRQ//V/Hy/srPDXXmc/CY6eI4jyJoLqOqbd7r8RQk+c5cJRTd0EqGzd8bjKgi wtZJGlSUeEbbNZnLCYt2NlDV+OMFF0rwxwsiFP9U+AN1QJHSTescbGnu0qs6AEvp SaTbDzhR4edqwGpEvFyFwJdIUFPWBRjaxU3G3SiQAwlUKXZ3/5REAfGFUT2U7Wf1 6DwmkGzIKduPpx6bbChaEBS3ql0GA5LcGnezC9FVr7xt5j+9olC5Ww0vy09JdNt3 Sa9ZctkfzjJIYzhdkGg6EWVcDVOhvou6bSO6x4tceldm/hAgyq9snlBuGAzHlYRk JbceKrHUTMVR77UOnNnKOmgl7R2YgBFubA63dLi0BdwHr8j2oUQw3XK/Ypu3u9Th y0nkais7dojf5AbDmNvF2q+AKHcOwetzvRbOqpxQ5KbxD/Nj1di1G5VOc7Z18Umf awzCU0E7PE2hZn0jYaLig3cb7RVTFlgRldUWU1AZ5Sg0IMHUuFZn9LcrY9u1I4vB 9CrMDPNhQwQG5Eh5MyvyiSAocPeyUfuvXwWGDqC2VYM2HKW+ebP85ss/bYukFNW7 LGHHLHqnviUMjcy0uCQAsESos/vZ0oTzvXmhb4rzX2hpf+bzgZo+p+7XEHZr9Gcv WhUUFFVsEngXF1V0CAdhWZRqoqIK2KOZNpotTKgQOr+IpwpcOiY= =6j5P -----END PGP SIGNATURE----- --UlVJffcvxoiEqYs2--