[Top][All Lists]
[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: |
Bruno Haible |
Subject: |
Re: [PATCH] time: enforce recent POSIX ruling that time_t is integral |
Date: |
Sat, 9 Oct 2010 21:22:34 +0200 |
User-agent: |
KMail/1.9.9 |
Hi Eric,
Thanks for this addition.
> +struct __time_t_must_be_integral {
> + unsigned int __floating_time_t_unsupported : 2 * ((time_t) 1 / 2 == 0) - 1;
> +};
I agree with the expression (personally I would have used (time_t) 0.5 == 0
but that's probably equivalent).
But why use __ as prefix? Symbols starting with __ are, generally speaking,
in the territory of the implementation (libc + compiler), which is why gnulib
tries to use only symbols that start with a single _.
> Hmm, given Bruno's recent point that C89 didn't require ?: support
> in constant expressions, should we re-visit verify.h to use
> (2 * cond - 1) instead of (cond ? 1 : -1)?
Currently it seems that all compilers support both. Therefore there is no
reason to change (cond ? 1 : -1) to (2 * cond - 1), but there is also no
reason to change it in the opposite direction.
Bruno
- Re: [coreutils] [PATCH 2/2] stat: print timestamps to full resolution, Eric Blake, 2010/10/08
- Re: [coreutils] [PATCH 2/2] stat: print timestamps to full resolution, Jim Meyering, 2010/10/08
- [PATCH] time: enforce recent POSIX ruling that time_t is integral, Eric Blake, 2010/10/08
- Re: [PATCH] time: enforce recent POSIX ruling that time_t is integral,
Bruno Haible <=
- Re: [PATCH] time: enforce recent POSIX ruling that time_t is integral, Paul Eggert, 2010/10/09
- Re: [PATCH] time: enforce recent POSIX ruling that time_t is integral, Bruno Haible, 2010/10/10
- Re: [PATCH] time: enforce recent POSIX ruling that time_t is integral, Paul Eggert, 2010/10/10
- Re: [PATCH] time: enforce recent POSIX ruling that time_t is integral, Paul Eggert, 2010/10/10
- Re: [PATCH] time: enforce recent POSIX ruling that time_t is integral, Bruno Haible, 2010/10/10
- Re: [PATCH] time: enforce recent POSIX ruling that time_t is integral, Paul Eggert, 2010/10/10
- Re: [PATCH] time: enforce recent POSIX ruling that time_t is integral, Bruno Haible, 2010/10/10
- Re: [PATCH] time: enforce recent POSIX ruling that time_t is integral, Paul Eggert, 2010/10/10
- [PATCH] Fix mismatched parens in previous commit, Gary V. Vaughan, 2010/10/11
- Re: [PATCH] Fix mismatched parens in previous commit, Jim Meyering, 2010/10/11