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 <ivo...@gmail.com> wrote: > > On Thu, 25 Jul 2024 14:17:51 -0400 enh via Toybox > <toybox@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@lists.landley.net > http://lists.landley.net/listinfo.cgi/toybox-landley.net _______________________________________________ Toybox mailing list Toybox@lists.landley.net http://lists.landley.net/listinfo.cgi/toybox-landley.net