This is the mail archive of the mailing list for the glibc project.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH 1/9] mktime: merge wrapv change from gnulib

> --- a/ChangeLog
> +++ b/ChangeLog
> @@ -124,6 +124,13 @@
>  	mktime: merge time_r change from gnulib
>  	* time/mktime.c [!_LIBC]: Do not include "time_r.h".
> +	mktime: merge wrapv change from gnulib
> +	* time/mktime.c (WRAPV): New macro.
> +	(time_t_avg, time_t_add_ok, time_t_int_add_ok): New static functions.
> +	(guess_time_tm, __mktime_internal): Do not assume that signed
> +	integer overflow wraps around; modern compilers generate code
> +	where this assumption is no longer valid.
> +
>  	mktime: merge DEBUG change from gnulib
>  	* time/mktime.c (mktime) [DEBUG]: #undef before #define-ing, in
>  	case system <time.h> has a #define.

You probably know all this, but just in case.  We don't usually include
ChangeLog bits in the diff.  In the actual commit, the entry needs to go at
the top of ChangeLog with an appropriate header line, not in the middle
of an old entry.

> +#ifndef WRAPV
> +# if (((__GNUC__ == 4 && 4 <= __GNUC_MINOR__) || 4 < __GNUC__) \
> +      && defined __GLIBC__)

In libc code we have __GNUC_PREREQ for this.
But this is fine if you need it this way to match in gnulib.

For the rest of the code, I can't claim to meaningfully understand what it
is doing.  But I don't see any style issues.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]