Compiler Warnings

Christos Zoulas christos at zoulas.com
Wed Apr 13 16:14:57 UTC 2011


On Apr 13,  9:38am, olsona at dc37a.nci.nih.gov ("Olson, Arthur David (NIH/NCI) [E]") wrote:
-- Subject: RE: Compiler Warnings

| Here’s an "increment_overflow" replacement that doesn't get any complaints from gcc.
| How can it be portably simplified?

I think that Paul Eggert posted a simpler one:

static int
increment_overflow(int *number, int delta)
{
        int     number0;

        number0 = *number; 
        if (delta < 0 ? number0 < INT_MIN - delta : INT_MAX - delta < number0)
                  return 1;
        *number += delta;
        return 0;
}


Any updates putting in the per timezone functionality in? I've committed
it to the NetBSD codebase and seems to work fine...

http://cvsweb.netbsd.org/bsdweb.cgi/src/lib/libc/time/?only_with_tag=MAIN

christos



More information about the tz mailing list