Re: Overcoming the proof of undecidability of the Halting Problem by a simple example in C

Liste des GroupesRevenir à theory 
Sujet : Re: Overcoming the proof of undecidability of the Halting Problem by a simple example in C
De : rjh (at) *nospam* cpax.org.uk (Richard Heathfield)
Groupes : comp.theory
Date : 19. May 2025, 01:01:34
Autres entêtes
Organisation : Fix this later
Message-ID : <100dscu$18b5s$1@dont-email.me>
References : 1 2 3 4 5 6 7 8 9 10
User-Agent : Mozilla Thunderbird
On 18/05/2025 23:18, Ben Bacarisse wrote:
Richard Heathfield <rjh@cpax.org.uk> writes:
...
If they know C they should know that it's
  u32 HHH(void (*P)()), according to Halt7.c.
>
It takes a pointer to a function that accepts no arguments and returns no
value.
 Yes, but I am surprised that you are being so modern!!  You used to
favour C90 and didn't really care for anything more recent.
I am just as surprised that you missed the distinction I was making, which was between these:
void HHH(void (*f)(void))
u32 HHH(void (*P)())
Empty parentheses had nothing to do with my point. On line 16 we find: typedef uint32_t u32;
uint32_t != void.

Empty ()s in a declarator were made obsolete in C17 and made equivalent
to (void) in C23.  Prior to C23 a parameter that is pointer to a
function taking no arguments would have to have been written as
    u32 HHH(void (*P)(void))
 and after C23 the (probable) intended meaning would have to be written
as
    u32 HHH(void (*P)(...))
but not void HHH(void (*f)(void)), eh?

(Caveat: I'm not properly up to date anymore and, this not being
comp.lang.c, I may not be corrected by People Who Really Know.)
I have no doubt you're right about (), but that wasn't the point I was making.
--
Richard Heathfield
Email: rjh at cpax dot org dot uk
"Usenet is a strange place" - dmr 29 July 1999
Sig line 4 vacant - apply within

Date Sujet#  Auteur
27 Apr 26 o 

Haut de la page

Les messages affichés proviennent d'usenet.

NewsPortal