This is the mail archive of the
libc-alpha@sources.redhat.com
mailing list for the glibc project.
Re: mktime.c fixes (part 4 of 6): verify assumptions at compile-time
- From: Richard Henderson <rth at twiddle dot net>
- To: Paul Eggert <eggert at CS dot UCLA dot EDU>
- Cc: libc-alpha at sources dot redhat dot com
- Date: Wed, 31 Dec 2003 10:19:05 -0800
- Subject: Re: mktime.c fixes (part 4 of 6): verify assumptions at compile-time
- References: <873cb11irp.fsf@penguin.cs.ucla.edu>
On Wed, Dec 31, 2003 at 12:41:30AM -0800, Paul Eggert wrote:
> +/* The code also assumes that signed integer overflow silently wraps
> + around, but this assumption can't be stated without causing a
> + diagnostic on some hosts. */
Such an assumption requires that you compile with -fwrapv with gcc.
Otherwise we may infer that a signed value cannot legitimately overflow,
and may reason based on that.
r~