[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
intprops and warnings
From: |
Simon Josefsson |
Subject: |
intprops and warnings |
Date: |
Wed, 06 Feb 2013 16:22:21 +0100 |
User-agent: |
Gnus/5.130006 (Ma Gnus v0.6) Emacs/24.2 (gnu/linux) |
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]
decoding.c:88:15: error: comparison of unsigned expression < 0 is always false
[-Werror=type-limits]
decoding.c:88:15: error: comparison of unsigned expression < 0 is always false
[-Werror=type-limits]
decoding.c:88:15: error: comparison of unsigned expression < 0 is always false
[-Werror=type-limits]
decoding.c:88:15: error: comparison of unsigned expression < 0 is always false
[-Werror=type-limits]
decoding.c:88:15: error: comparison of unsigned expression < 0 is always false
[-Werror=type-limits]
decoding.c:88:15: error: comparison of unsigned expression < 0 is always false
[-Werror=type-limits]
decoding.c:88:15: error: comparison of unsigned expression < 0 is always false
[-Werror=type-limits]
The code in question is:
62 long
63 asn1_get_length_der (const unsigned char *der, int der_len, int *len)
64 {
65 unsigned int ans;
...
86 while (punt <= k && punt < der_len)
87 {
88 if (INT_MULTIPLY_OVERFLOW (ans, 256))
89 return -2;
Is there a problem in the libtasn1 code?
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.
/Simon
- intprops and warnings,
Simon Josefsson <=