This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
handy.h: Avoid compiler warnings for withinCOUNT()
If a parameter to this function is unsigned, gcc, at least, generates a
comparison-always-true warning for the asserts on the parameters.
Silence these by casting to an NV. Any extra machine instructions will
be gone from non-DEBUGGING builds. The value in an NV won't necessarily
be exact, but all the assertions care about is the sign, which is
guaranteed by C11 standard 6.3.1.4 item 2.
This technique was the idea of Tomasz Konojacki.