bug-gnulib
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH] time: enforce recent POSIX ruling that time_t is integral


From: Paul Eggert
Subject: Re: [PATCH] time: enforce recent POSIX ruling that time_t is integral
Date: Sat, 09 Oct 2010 12:33:55 -0700
User-agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.1.12) Gecko/20100915 Thunderbird/3.0.8

>> Hmm, given Bruno's recent point that C89 didn't require ?: support
>> in constant expressions

I'm skeptical of that.  I can't find my copy of the official C89 standard,
but the draft <http://flash-gordon.me.uk/ansi.c.txt> says that
constant expressions can contain ?:.  In fact, the grammar in
section 3.4 looks like this:

         constant-expression:
                  conditional-expression

and until this discussion I've never heard of the claim that
one cannot use ?: in constant expressions.

Given that (X ? 1 : -1) captures the concept more clearly than
(2 * X - 1), we're better off using the former notation than
the latter.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]