]> git.ipfire.org Git - thirdparty/grub.git/commit
json: Remove invalid typedef redefinition
authorPatrick Steinhardt <ps@pks.im>
Mon, 7 Sep 2020 15:27:32 +0000 (17:27 +0200)
committerDaniel Kiper <daniel.kiper@oracle.com>
Fri, 11 Sep 2020 13:46:55 +0000 (15:46 +0200)
commitb35792dccb44aff310b0461ba89abdf01d28a3f0
tree37c951789c42f367ee37548f11a67e5595b2514b
parent74259522d741cbf1937eeea01d60fa17e43e0554
json: Remove invalid typedef redefinition

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 <ps@pks.im>
Tested-by: Chuck Tuffli <chuck@freebsd.org>
Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com>
grub-core/lib/json/json.h