Sujet : Re: Every D(D) simulated by H presents non-halting behavior to H ###
De : jameskuyper (at) *nospam* alumni.caltech.edu (James Kuyper)
Groupes : comp.theory comp.lang.cDate : 18. May 2024, 18:49:24
Autres entêtes
Organisation : A noiseless patient Spider
Message-ID : <v2am6k$2s12h$2@dont-email.me>
References : 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30
User-Agent : Mozilla Thunderbird
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.