[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Emacs-diffs] master b7fa6b1 1/4: Simplify use of FOR_EACH_TAIL
From: |
Johan Bockgård |
Subject: |
Re: [Emacs-diffs] master b7fa6b1 1/4: Simplify use of FOR_EACH_TAIL |
Date: |
Tue, 07 Feb 2017 21:45:34 +0100 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/25.0.50 (gnu/linux) |
Paul Eggert <address@hidden> writes:
> Portable C99 code cannot declare two or more identifiers in the same
> for-loop, due to an ambiguity in the C99 standard, which says (6.8.5
> para 3) "The declaration part of a for statement shall only declare
> identifiers for objects having storage class auto or register." This
> constraint can be interpreted as meaning (A) when a for-statement
> declares an object's name, the name must have storage class auto or
> register, or (B) all identifiers declared by a for-statement must name
> objects with storage class auto or register. Although I suspect (A)
> was intended and that's what GCC does, (B) is also a plausible
> interpretation and that's what Clang does. Interpretation (B)
> disallows anonymous structs here, as such structs declare member
> names.
"The intent is clear enough; [...] identifiers which do not denote
objects with auto or register storage classes, [...] are not allowed
in this context."
http://www.open-std.org/jtc1/sc22/wg14/www/docs/dr_277.htm