RE: flag to disable -Wextra check for unsigned compared to 0

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi Ethan,

>Our code has a configuration header file with stuff like:
    const unsigned NUM_SENSORS = N;

One strategy is to change those to:
    const int NUM_SENSORS = N;

The rule of thumb being "Use int instead of unsigned int, unless you HAVE to use unsigned int.  And even then, strongly consider using int instead if feasible."

I don't buy into that rule of thumb, which is promoted by several other software engineers who I respect.  But it is something that I'm rolling around and considering.

HTH,
--Eljay


[Index of Archives]     [Linux C Programming]     [Linux Kernel]     [eCos]     [Fedora Development]     [Fedora Announce]     [Autoconf]     [The DWARVES Debugging Tools]     [Yosemite Campsites]     [Yosemite News]     [Linux GCC]

  Powered by Linux