Sujet : Re: Every D(D) simulated by H presents non-halting behavior to H ###
De : mikko.levanto (at) *nospam* iki.fi (Mikko)
Groupes : comp.lang.cDate : 19. May 2024, 12:23:21
Autres entêtes
Organisation : -
Message-ID : <v2cjup$3b6ib$1@dont-email.me>
References : 1 2 3 4 5
User-Agent : Unison/2.2
On 2024-05-18 16:49:24 +0000, James Kuyper said:
On 5/18/24 12:01, Fred. Zwarts wrote:
...
On 2024-05-15 15:24:57 +0000, olcott said:
...
00 int H(ptr x, ptr x);
...
Another issue seems to be that in the declaration of H:
int H(ptr x, ptr x);
both parameters have the same name.
(Olcott is famous for using the same name for different objects.)
The standard requires that different entities designated by the same
identifier must either have different scopes or different namespaces.
(6.2.1p2). In a function declaration that is not part of a function
definition, the parameter names have all function prototype scope
(6.2.1p4) and belong to the ordinary identifier name space (6.2.3p1).
This is not labelled as a constraint or syntax error, but the standard
fails to say what should be done with code that doesn't follow this
rule, so the behavior is undefined "by omission of any explicit
definition of the behavior".
In a function definition, the parameter names have block scope and
belong to the ordinary identifier name space, and therefore must not
only avoid duplicating each other, but must also avoid duplicating any
identifier declared in the outermost block of the function.
Thank you. That is what I wanted to know.
Which version of the standard do the references refer to? I don't expect
these things vary from one version to the next but section and paragraph
numbers might.
-- Mikko