grub-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH] json: Remove invalid typedef redefinition


From: Daniel Kiper
Subject: Re: [PATCH] json: Remove invalid typedef redefinition
Date: Fri, 29 May 2020 13:53:48 +0200
User-agent: NeoMutt/20170113 (1.7.2)

On Wed, May 27, 2020 at 11:18:24AM +0200, Patrick Steinhardt wrote:
> 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>

Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com>

Daniel A., could you check this patch?

> ---
>
> Sorry for the late response, didn't notice at first that this directly
> impacts code I wrote. I don't have Clang available on my computer and
> GCC seems to lack the equivalent option for this, so I wasn't able to
> reproduce the warning. Below patch should fix the issue, though, as we
> simply avoid using a typedef for the forward declaration.

Not a problem. Thanks a lot for fixing this issue...

Daniel



reply via email to

[Prev in Thread] Current Thread [Next in Thread]