flag to disable -Wextra check for unsigned compared to 0

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

 



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

Depending on the target we're compiling for, 'N' could be 0. In which case, all our loops:
	for(unsigned i=0; i<NUM_SENSORS; i++) { /* ... */ }
spew the warning:
	warning: comparison of unsigned expression < 0 is always false

I'd like to keep -W / -Wextra enabled for the other things it provides, but this particular warning is gumming up the works.

As far as I know, there's no flag (a la -Wno-sign-compare) for this particular warning. Correct?

Can somebody please request (or point me where I can request) a flag be added to override this aspect of -Wextra? From some web searching, it appearsmy usage example is a fairly common pattern where this warning is discouraging desirable abstraction/generalization.

thanks,
  -ethan


[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