[U-Boot] [PATCH 1/1] vsprintf.c: add EFI device path printing

Wolfgang Denk wd at denx.de
Sun Nov 26 13:11:33 UTC 2017


Dear Heinrich,

In message <3e2e7f27-2fb6-97ad-bbab-f014b7ef684b at gmx.de> you wrote:
>
> You are absolutely right. The C standard defines printf as returning a
> negative number if an error arises.

This is what we (what to) have in U-Boot, too.

> set_config_filename, dbg_snprintf_key(), bootstage_mark_code() - to name
> a few - will access illegal memory addresses.

In this case you have identified a number of bugs, that need fixing.

> As long as we cannot assure that each and every caller of a printf
> function handles negative return values correctly the only safe handling
> of errors is to return 0 or panic().

Come on, be serious.  Of course we MUST assume that all callaers of
a function behave according o the specs.  If they don;t then need
fixing.  But you must NEVEr change behaviour of any code to deviate
from the spec and documention just because you fear thay you lose
bug compatibility.  That would be crazy.


Best regards,

Wolfgang Denk

-- 
DENX Software Engineering GmbH,      Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
The IQ of the group is the lowest IQ of a member of the group divided
by the number of people in the group.


More information about the U-Boot mailing list