Malcolm: Usability improvements in GCC 8
Malcolm: Usability improvements in GCC 8
Posted Mar 22, 2018 4:32 UTC (Thu) by ncm (guest, #165)Parent article: Malcolm: Usability improvements in GCC 8
I would like it to suggest alternatives to comparing signed with unsigned values. Too often I see people add a cast, or change the type of a variable, when 9 times out of 10, changing < to != is the better choice. (In C and, still, in C++, (-1 < 0u) is false, hence the warning. But the C++ people have vowed to fix it someday -- most likely c. 2029.)
By the way, the compiler people say "for (int i =..." is much better, nowadays, than "for (size_t i =...", although of course "for (auto val : ..." or "std::foreach(..." is better than either.
