[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: |
Paul Eggert |
Subject: |
Re: [PATCH] time: enforce recent POSIX ruling that time_t is integral |
Date: |
Sun, 10 Oct 2010 14:27:22 -0700 |
User-agent: |
Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.1.12) Gecko/20100915 Thunderbird/3.0.8 |
On 10/10/2010 02:15 PM, Bruno Haible wrote:
> 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.
By the same argument, a compiler is also free to support
struct foo { unsigned int bar : -1 };
as an extension, and therefore none of gnulib's verification code
can possibly work.
Which obviously is not the case. The C Standard requires a diagnostic
for the above declaration, because the "-1" violates a constraint.
Similarly, the C Standard requires a diagnostic if we replace
"-1" with "1.0", because the requirement that the bitfield width
must be an integral constant expression is a constraint, and
constraint violations must be diagnosed.
If there were a popular nonstandard compiler that accepted these
declarations without complaint, then we'd be in trouble. But
fortunately for us, that's not the case.
- Re: [coreutils] [PATCH 2/2] stat: print timestamps to full resolution, (continued)
- 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, 2010/10/09
- 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 <=
- [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
- Re: [PATCH] Fix mismatched parens in previous commit, Gary V. Vaughan, 2010/10/11
- Re: [PATCH] Fix mismatched parens in previous commit, Paul Eggert, 2010/10/11
- [PATCH] rewrite int foo[2*X-1] to verify(X) or to int foo[X?1:-1], Paul Eggert, 2010/10/10
- Re: [PATCH] rewrite int foo[2*X-1] to verify(X) or to int foo[X?1:-1], Bruno Haible, 2010/10/10
- Re: [PATCH] rewrite int foo[2*X-1] to verify(X) or to int foo[X?1:-1], Paul Eggert, 2010/10/10