[RFC PATCH 03/28] cli: lil: Replace strclone with strdup

Rasmus Villemoes rasmus.villemoes at prevas.dk
Fri Jul 2 10:36:52 CEST 2021


On 01/07/2021 08.15, Sean Anderson wrote:
> Apparently strdup is not portable, so LIL used its own. Use strdup.

You could reduce the churn by just making strclone "#define strclone(x)
strdup(x)", but I suppose you end up modifying the upstream code so much
that there's not really anything gained by that.

But that begs the question: What is the long-term plan for this? While
it does seem to be an improvement compared to hush, will we ever be able
to incorporate fixes&features from upstream, or will this code end up in
the same situation as hush?

Have you been in contact with upstream about this project? Perhaps some
of the things you do could go upstream - e.g. the conversion from an
array of wrongly-typed callbacks to an "ops" struct seems to be an
obvious improvement [lil_callback would have to be kept, and changed to
use a switch() statement to update the right slot, but we wouldn't have
to care because ld will remove it anyway if we don't add any users of it].

Rasmus


More information about the U-Boot mailing list