From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from list by lists.gnu.org with archive (Exim 4.90_1) id 1k9njL-00008S-V4 for mharc-grub-devel@gnu.org; Sun, 23 Aug 2020 07:00:07 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:41600) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1k9njJ-00007G-8O for grub-devel@gnu.org; Sun, 23 Aug 2020 07:00:05 -0400 Received: from new2-smtp.messagingengine.com ([66.111.4.224]:51225) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1k9njG-00085U-Ja for grub-devel@gnu.org; Sun, 23 Aug 2020 07:00:04 -0400 Received: from compute3.internal (compute3.nyi.internal [10.202.2.43]) by mailnew.nyi.internal (Postfix) with ESMTP id ECD4F580332; Sun, 23 Aug 2020 07:00:01 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute3.internal (MEProxy); Sun, 23 Aug 2020 07:00:01 -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=joWEbWEVXkd1Fv3oqbQtdrwNnP+ LusJznC2Kwe2s3dQ=; b=fmqjSCHRHdCB8YbHg8DyWnkRPMc1x3icIbl10OCot15 KxVWd+Pz3vWxFkV5w/AeYmmr7XnzT1clvoEJf2chKnCTJtXctr9JV+RYrsVbBdEY 2AjLnzICQ2SI3VgEOE7LnFaiBbZDRUGMCDZdAhz9XjdmjkoDj8GugAt2Fe9wjgtW W+5EBLDfmT+nhc0wmBP626DeT75FrCFP9AhElGxMEZTkJCt6xYH/5Ti0EJPqj7aI BIESIVsIFbqxUHpTsGIPul461ixa1/PddOnfSHKoPDJG317c3o4PFIP6yopUVf4E Fmq5/fWwbB/If9rNc0R6LEepTsow/4Ltd3wyAJ4cF7Q== 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=joWEbW EVXkd1Fv3oqbQtdrwNnP+LusJznC2Kwe2s3dQ=; b=s5WsNaqKmoE0ngF/2ML6KA PSUoYa6Qp3yLtJ85Masa03t4BCDbvbo3Hh1m9Hj6S4BuA7dC5/gH5RpXnMpJ9GG7 t4CXJ7C4L93U5ow3zbTYpuL+jMdddGWGUrrK5aAe1Q1LatSNKVAkyEW4Tz1mt7Mh w9iY1D948ieq07XvRdllsQ5dVZLnvJ0TBytEp+OSbd4Ib9eorHoMhmc17PSRv9LP pDCPc8MKvOTDpI6RpcgrBGqrX0oXDk2XpFwIdFaw2QNX4pBCI90Dp5J37GiPEE6f hH+BF78GV4NB3YYC0+NsdPVv05W/lPeYR/gBYLZbDbUm6WGsMkTbAS2nuYYjOjWQ == X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeduiedrudduiedgfeeiucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhepfffhvffukfhfgggtuggjsehgtderredttddvnecuhfhrohhmpefrrghtrhhi tghkucfuthgvihhnhhgrrhguthcuoehpshesphhkshdrihhmqeenucggtffrrghtthgvrh hnpeehgefhtdefueffheekgfffudelffejtdfhvdejkedthfehvdelgfetgfdvtedthfen ucfkphepjeejrddukeefrdehkedrudelheenucevlhhushhtvghrufhiiigvpedtnecurf grrhgrmhepmhgrihhlfhhrohhmpehpshesphhkshdrihhm X-ME-Proxy: Received: from vm-mail.pks.im (x4db73ac3.dyn.telefonica.de [77.183.58.195]) by mail.messagingengine.com (Postfix) with ESMTPA id 2A66A328005A; Sun, 23 Aug 2020 06:59:51 -0400 (EDT) Received: from localhost (ncase [10.192.0.11]) by vm-mail.pks.im (OpenSMTPD) with ESMTPSA id ec6f4f1b (TLSv1.3:TLS_AES_256_GCM_SHA384:256:NO); Sun, 23 Aug 2020 10:59:50 +0000 (UTC) Date: Sun, 23 Aug 2020 12:59:52 +0200 From: Patrick Steinhardt To: grub-devel@gnu.org Cc: Denis 'GNUtoo' Carikli , Glenn Washburn , Daniel Kiper Subject: [PATCH 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="FL5UXtIhxfXey3p5" Content-Disposition: inline In-Reply-To: Received-SPF: pass client-ip=66.111.4.224; envelope-from=ps@pks.im; helo=new2-smtp.messagingengine.com X-detected-operating-system: by eggs.gnu.org: First seen = 2020/08/23 06:59:58 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, 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: Sun, 23 Aug 2020 11:00:05 -0000 --FL5UXtIhxfXey3p5 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 --FL5UXtIhxfXey3p5 Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAABCgAdFiEEF9hrgiFbCdvenl/rVbJhu7ckPpQFAl9CTCcACgkQVbJhu7ck PpTKyA/9EXKQFTulQds93CiD2d2py6k8jNz/tP0snCQCbNQiaM4QiHCXqN3F9B3B 4kT/i1OeJ1KN7YJr8KShFaPA+MSgMuvbvkOQIt+aZWlm9sIGMN4l0y8gMm7N/y7g UNwSrUgE63z2qz/8a747oWGbHhs56HzPlqjdW/bCeL3NVXLJ1ukAUbSp1lwjp5uz PVxqPrbfrgIZ+H28FOJdLUZXJioZRmhd7zEQlaU3T5etyf49QmMbdHl5WdOjd4gH CUdfsbCmn8NpYX7OTYMsmZ/LRFSjiH/oEORSPE6BkKyoKInoxMymDZaltJJNpXIJ JQYNestGoAG+uZYnvY4zWawg9SG0ePgpTXGq+fZ8qk9XBEpz7CTuPM8w3S7IxeTS Mw3Lu12G493msBJ5kMA6u705YDBYmRFOfTV40nH3KpNnferle0kER4wp7FOTNTLO gSP+KBck6soEaTVGXHljbSSnTVZuj2+o5jb4N6YITCwBJzzQ1+GN8S3mKvbYodki sJaniWQmrswtVapVfmR4w/PP/P8uoyJtS5IOEH6rHx3/lkpAQ+gEA57+IRExZC6I g+oeHkBhCy/Rp2EWZc20oft7xtGf3q7qTILv7qZ/kGd7/HZaT4fvRJWEA1RN6TJr yYnuZaeZ1ZkW8wGnXB10lcCML+1EMdMGR7NUtJcyTWC8GzFTQjI= =p86F -----END PGP SIGNATURE----- --FL5UXtIhxfXey3p5--