Paul Eggert wrote:
> * lib/time.in.h (struct __time_t_must_be_integral): Rewrite
> 2 * ((time_t) 1 / 2 == 0) - 1 to (time_t) 1; this suffices to
> verify that time_t cannot be floating.

I disagree that this is enough. The C standard says that a cast to floating-
point types cannot be portably used in integer constant expressions. But a
compiler is free to support this, as an extension. _If_ a compiler supports
it as an extension, then
  2 * ((time_t) 1 / 2 == 0) - 1           will evaluate to -1
  (time_t) 0.5 == 0 ? 1 : -1              will evaluate to -1
but the expression you put in:
  (time_t) 1                              will evaluate to 1

Bruno

Reply via email to