On 02/06/2013 03:31 PM, Eric Blake wrote:
On 02/06/2013 08:22 AM, Simon Josefsson wrote:
Libtasn1 recently started to use the intprops module, however it
generates warnings:
make[3]: Entering directory `/home/jas/src/libtasn1/lib'
CC decoding.lo
decoding.c: In function 'asn1_get_length_der':
decoding.c:88:15: error: comparison of unsigned expression < 0 is always false
[-Werror=type-limits]
Similar issue to http://gcc.gnu.org/bugzilla/show_bug.cgi?id=43772
Yes, we've known about the problem in the past:
https://lists.gnu.org/archive/html/bug-gnulib/2011-05/msg00555.html
https://lists.gnu.org/archive/html/bug-gnulib/2011-05/msg00561.html
but I was unable to solve it at the time.
Since then, we have started using gcc pragmas to push and pop warnings,
maybe we could exploit that to at least allow you to still use the
warning category elsewhere, when using modern gcc (with older gcc, you'd
still have to avoid the warning entirely).
Is this an unavoidable consequences of using the intprops module? Then
I'll just add -Wno-error=type-limits, although that seems unfortunate to
need that since we didn't before.
Unfortunately, without patches to intprops, -Wtype-limits and intprops
do not play nicely.
+1 to using gcc pragmas to disable the warning for just that module.
Note that's only supported in gcc >= 4.6 and thus coreutils for example
only auto enabled gcc warnings on newer gccs.
http://git.sv.gnu.org/gitweb/?p=coreutils.git;a=commit;h=82b1728
thanks,
Pádraig.