emacs-devel
[Top][All Lists]
Advanced

[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: Paul Eggert
Subject: Re: [Emacs-diffs] master b7fa6b1 1/4: Simplify use of FOR_EACH_TAIL
Date: Mon, 6 Feb 2017 17:04:20 -0800
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.7.0

On 02/06/2017 09:38 AM, Davis Herring wrote:
Did you just mean that you couldn't have that variable declared and also the tortoise integer declared because they were different types (and you didn't want to open a pair of braces in the macro that would have to be closed later)?

Yes, that sort of thing, although it's not that they are different types.

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.




reply via email to

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