On Tue, May 27, 2014 at 08:59:20AM -0600, Eric Blake wrote: > On 05/27/2014 04:41 AM, Benoît Canet wrote: > > >> - fprintf(stderr, "%s: can't open device %s: %s\n", progname, > >> name, > >> + fprintf(stderr, "%s: can't open%s%s: %s\n", progname, > >> + name ? " device " : "", name ?: "", > > > > name ?: "" seems to be a GNU C extension: see > > http://en.wikipedia.org/wiki/%3F:#C > > > > Don't we want this code to work on most compilers ? > > It already works on all 2 compilers we actively support (gcc and clang), > and this is not the first instance of this extension in the code base: > > $ git grep '\?:' | wc > 210 1081 15271 > > If it ever becomes a real portability problem to someone trying to port > to another compiler, it would be a search-and-replace fix to the whole > tree at that time. >
A few areas we've used the extension '?:' would have side affects if changed to the traditional A ? A : B format, as well.