On 10/05/2016 09:17 AM, Jim Meyering wrote:
* lib/utimecmp.c (utimecmp): Do not apply "~" to a boolean.

Hah! And just Monday I was telling students how C operations like binary +, unary and binary -, and ~ can produce non-boolean outputs when given boolean inputs. That's a feature, not a bug.

While I'm ranting, another thing that bothers me is that gcc -Wall doesn't know that == is both commutative and associative on booleans: it complains about "a==b==c" even when all arguments are boolean so that inserting parentheses cannot reduce ambiguity. It's times like this that I think GCC's '-Wall' option should really be called '-Wnanny'.


Reply via email to