[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
parse-datetime.y reports integer overflow when compiled with gcc 5.5.0
From: |
Sergey Poznyakoff |
Subject: |
parse-datetime.y reports integer overflow when compiled with gcc 5.5.0 |
Date: |
Fri, 08 Jan 2021 16:37:02 +0200 |
Hello,
With recent gnulib (v0.1-4336-gbdae9a5), attempting to compile
parse-datetime.c fails with:
$ make -k parse-datetime.o V=1
gcc -DHAVE_CONFIG_H -I. -I.. -Wall -ggdb -MT parse-datetime.o -MD -MP -MF
.deps/parse-datetime.Tpo -c -o parse-datetime.o parse-datetime.c
In file included from parse-datetime.y:39:0:
parse-datetime.y: In function 'to_tm_year':
intprops.h:578:17: warning: integer overflow in expression [-Woverflow]
|| (tmax) + (b) < (a)))
^
intprops.h:524:4: note: in expansion of macro '_GL_INT_SUBTRACT_RANGE_OVERFLOW'
(overflow (a, b, tmin, tmax) \
^
intprops.h:491:10: note: in expansion of macro '_GL_INT_OP_CALC'
? _GL_INT_OP_CALC (a, b, r, op, overflow, unsigned int, \
^
intprops.h:389:4: note: in expansion of macro '_GL_INT_OP_WRAPV'
_GL_INT_OP_WRAPV (a, b, r, -, _GL_INT_SUBTRACT_RANGE_OVERFLOW)
^
parse-datetime.y:1274:9: note: in expansion of macro 'INT_SUBTRACT_WRAPV'
: INT_SUBTRACT_WRAPV (year, TM_YEAR_BASE, tm_year))
^
parse-datetime.y: In function 'yylex':
intprops.h:578:17: warning: integer overflow in expression [-Woverflow]
|| (tmax) + (b) < (a)))
^
intprops.h:524:4: note: in expansion of macro '_GL_INT_SUBTRACT_RANGE_OVERFLOW'
(overflow (a, b, tmin, tmax) \
^
intprops.h:500:11: note: in expansion of macro '_GL_INT_OP_CALC'
? _GL_INT_OP_CALC (a, b, r, op, overflow, unsigned long int, \
^
intprops.h:495:7: note: in expansion of macro '_GL_INT_OP_WRAPV_LONGISH'
: _GL_INT_OP_WRAPV_LONGISH(a, b, r, op, overflow))
^
intprops.h:389:4: note: in expansion of macro '_GL_INT_OP_WRAPV'
_GL_INT_OP_WRAPV (a, b, r, -, _GL_INT_SUBTRACT_RANGE_OVERFLOW)
^
parse-datetime.y:1469:23: note: in expansion of macro 'INT_SUBTRACT_WRAPV'
if (INT_SUBTRACT_WRAPV (s, 1, &s))
^
Bisecting shows that the bug was introduced by commit
55168f5fa7b3b95fbaa2be525b15f6ecd5500c02
Regards,
Sergey
- parse-datetime.y reports integer overflow when compiled with gcc 5.5.0,
Sergey Poznyakoff <=