[PATCH 1/3] cmd: setexpr: add fmt format string operation

Wolfgang Denk wd at denx.de
Tue Jun 29 10:44:45 CEST 2021


Dear Rasmus,

In message <4c69688f-c187-ad14-5cfe-cdcddc71f5c8 at prevas.dk> you wrote:
>
> I think this allows a lone % to appear at the end of the string after
> the actual %d, i.e. it seems "%d bla %" would be accepted.

there are a lot of highly unintuitive restrictions in that code,
indeed.

> I think allowing "arbitrary" format strings, restricted to those
> expected exactly one integer argument, is too fragile and error-prone.

Indeed.  See for example the "printf" (bash) shell builtin - we
should have a similar flexibility here.

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
Humanity has the  stars  in  its  future,  and  that  future  is  too
important  to be lost under the burden of juvenile folly and ignorant
superstition.                                          - Isaac Asimov


More information about the U-Boot mailing list