In the 3.0.4 Linux kernel, mm/filemap.c has this line of code:
retval = retval ?: desc.error;
I've tried compiling a similar minimal test case with gcc -Wall and don't get any warnings; the behavior seems identical to:
retval = retval ? retval : desc.error;
Looking at the C99 standard, I can't figure out what formally describes this behavior. Why is this OK?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…