[PATCH v2 1/1] sandbox: redefine getc()

Tom Rini trini at konsulko.com
Tue Sep 29 20:50:04 CEST 2020


On Tue, Sep 29, 2020 at 08:43:12PM +0200, Heinrich Schuchardt wrote:

> The sandbox is built with the SDL2 library with invokes the X11 library
> which in turn calls getc(). But getc() in glibc is defined as
> 
>     int getc(FILE *)
> 
> This does not match our definition.
> 
>     int getc(void)
> 
> The sandbox crashes when called with parameter -l.
> 
> Rename our library symbol to be called _u_boot_getc(). To keep the coding
> changes minimal use a define on the sandbox only.
> 
> Signed-off-by: Heinrich Schuchardt <xypron.glpk at gmx.de>
> ---
> v2:
> 	apply changes only to the sandbox

Wolfgang, I was wondering could we not, given the few callers of 'getc'
carefully change our internal usage / name to 'getchar', which is more
POSIX-like and have our EXPORT_FUNC line be:
EXPORT_FUNC(getc, int, getchar, void)
and that might be the clean solution here?

-- 
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 659 bytes
Desc: not available
URL: <https://lists.denx.de/pipermail/u-boot/attachments/20200929/2b60e470/attachment.sig>


More information about the U-Boot mailing list