[Toybox] [PATCH] devmem: add -f FILE, arbitrary amounts of data.

enh enh at google.com
Fri Jul 26 05:13:51 PDT 2024


with 80 existing uses of https://en.wikipedia.org/wiki/Elvis_operator
in toybox, i'm pretty sure rob knows this already :-)

On Thu, Jul 25, 2024 at 6:01 PM Ivo van Poorten <ivopvp at gmail.com> wrote:
>
> On Thu, 25 Jul 2024 14:17:51 -0400 enh via Toybox
> <toybox at lists.landley.net> wrote:
> > +    fd = xopen(TT.f ?: "/dev/mem", (writing ? O_RDWR : O_RDONLY) |
> > O_SYNC);
>
> Don't know Rob cares about this, but ?: is not ISO C. It's a GNU
> extension. Up until a few minutes ago I didn't even know this existed :)
> Would be nice if this was eventually added to the C standard as it's
> clearly very handy and it also avoids double evaluation in case of foo =
> f(x) ? f(x) : bar;
>
> Regards,
> Ivo
> _______________________________________________
> Toybox mailing list
> Toybox at lists.landley.net
> http://lists.landley.net/listinfo.cgi/toybox-landley.net


More information about the Toybox mailing list