diff options
author | Paul Eggert <eggert@cs.ucla.edu> | 2011-01-29 23:59:31 -0800 |
---|---|---|
committer | Paul Eggert <eggert@cs.ucla.edu> | 2011-01-30 00:00:00 -0800 |
commit | ee9e39c014e2880179c91960ce1f69309d0c1500 (patch) | |
tree | 11654c2892678ea15c6fa939af91e1062bb1eb31 /ChangeLog | |
parent | 56887e878833f53c8ca55371c0e4be66388e157b (diff) | |
download | gnulib-ee9e39c014e2880179c91960ce1f69309d0c1500.tar.gz |
TYPE_MAXIMUM: avoid theoretically undefined behavior
* lib/intprops.h (TYPE_MINIMUM, TYPE_MAXIMUM): Do not shift a
negative number, which the C Standard says has undefined behavior.
In practice this is not a problem, but might as well do it by the book.
Reported by Rich Felker and Eric Blake; see
<http://lists.gnu.org/archive/html/bug-gnulib/2011-01/msg00493.html>.
* lib/strtol.c (TYPE_MINIMUM, TYPE_MAXIMUM): Likewise.
* m4/mktime.m4 (AC_FUNC_MKTIME): Likewise.
* m4/nanosleep.m4 (gl_FUNC_NANOSLEEP): Likewise.
* m4/parse-datetime.m4 (gl_PARSE_DATETIME): Likewise.
* m4/stdint.m4 (gl_STDINT_H): Likewise.
* lib/mktime.c (TYPE_MAXIMUM): Redo slightly to match the others.
Diffstat (limited to 'ChangeLog')
-rw-r--r-- | ChangeLog | 13 |
1 files changed, 13 insertions, 0 deletions
@@ -1,5 +1,18 @@ 2011-01-29 Paul Eggert <eggert@cs.ucla.edu> + TYPE_MAXIMUM: avoid theoretically undefined behavior + * lib/intprops.h (TYPE_MINIMUM, TYPE_MAXIMUM): Do not shift a + negative number, which the C Standard says has undefined behavior. + In practice this is not a problem, but might as well do it by the book. + Reported by Rich Felker and Eric Blake; see + <http://lists.gnu.org/archive/html/bug-gnulib/2011-01/msg00493.html>. + * lib/strtol.c (TYPE_MINIMUM, TYPE_MAXIMUM): Likewise. + * m4/mktime.m4 (AC_FUNC_MKTIME): Likewise. + * m4/nanosleep.m4 (gl_FUNC_NANOSLEEP): Likewise. + * m4/parse-datetime.m4 (gl_PARSE_DATETIME): Likewise. + * m4/stdint.m4 (gl_STDINT_H): Likewise. + * lib/mktime.c (TYPE_MAXIMUM): Redo slightly to match the others. + mktime: #undef mktime before #defining it * lib/mktime.c (mktime) [DEBUG]: #undef mktime before #defining it. |