Here is a patch to bring glibc mktime.c into sync with gnulib mktime.c.
The gnulib mktime.c uses a different method to avoid the GCC 4.0.0 warning,
one that generated 128 bytes less machine code on my platform (x86, gcc -O2).
Also, there is some other minor reorganization of the gnulib type macros
to make them consistent with other gnulib code.
This change does not affect behavior, other than the minor effect on
I'll attach the patch.
Created attachment 530 [details]
mktime.c import from gnulib
Subject: Bug 1033
Module name: libc
Changes by: firstname.lastname@example.org 2005-09-08 08:09:08
time : mktime.c
2005-06-23 Paul Eggert <email@example.com>
* time/mktime.c: Import from gnulib.
The following macros are now consistent with other gnulib code.
This does not change mktime's behavior.
(TYPE_IS_INTEGER): New macro.
(time_t_is_integer): Use it.
(TYPE_TWOS_COMPLEMENT): New macro.
(twos_complement_arithmetic): Use it.
(TYPE_ONES_COMPLEMENT): New macro.
(TYPE_MINIMUM, TYPE_MAXIMUM): Now supports signed-magnitude.
mktime doesn't use this, but the code now matches other gnulib code.
(ranged_convert): Pacify GCC 4.0 in a different way, which
generates a few bytes less code.
(ranged_convert, __mktime_internal): When calling a function via a
pointer P, use P () rather than (*P) (), as we now assume C89 or