[Top][All Lists]

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

Re: [PATCH 01/11] Fix base64 module to work with grub codebase

From: Simon Josefsson
Subject: Re: [PATCH 01/11] Fix base64 module to work with grub codebase
Date: Wed, 27 Oct 2021 13:15:52 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/27.1 (gnu/linux)

Robbie Harwood <rharwood@redhat.com> writes:

> The gnulib module makes use of booleans via the <stdbool.h> header. As
> GRUB does not provide any POSIX wrapper header for this, but instead
> implements support for bool in <sys/types.h>, we need to patch
> base64.h to not use <stdbool.h> anymore. We unfortunately cannot include
> <sys/types.h> instead, as it would then use gnulib's internal header
> while compiling the gnulib object but our own <sys/types.h> when
> including it in a GRUB module. Because of this, the patch replaces the
> include with a direct typedef.

Thanks for trying to upstream diverged gnulib code!

I think this patch is wrong -- gnulib includes a stdbool.h replacement
you can you use, and the base64 module depends on the stdbool module
already.  Is there a problem with the stdbool module?  If so, let's fix

> A second fix is required to make available _GL_ATTRIBUTE_CONST, which
> is provided by the configure script. As base64.h does not include
> <config.h>, it is thus not available and results in a compile error.
> This is fixed by adding an include of <config-util.h>.

I think I agree that this is a problem, but your solutions seems wrong.
There are plenty of header files in gnulib that relies on definitions in
config.h created by the m4 macro that came with the hader file, yet the
header file do not #include config.h as usually that is supposed to be
done by the .c file that include the (say) base64.h header file.  I'm
not sure assumption is documented anywhere, and if so we should document
it.  I think this is how it is supposed to work, but if it isn't, we
should try to come up with a solution for it and document that.


Attachment: signature.asc
Description: PGP signature

reply via email to

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