olcott <
polcott333@gmail.com> writes:
On 5/8/2025 6:49 PM, Keith Thompson wrote:
olcott <polcott333@gmail.com> writes:
[...]
void DDD()
{
HHH(DDD);
return;
}
>
If you are a competent C programmer then you
know that DDD correctly simulated by HHH cannot
possibly each its own "return" instruction.
"cannot possibly each"?
I am a competent C programmer (and I don't believe you can make
the same claim). I don't know what HHH is. The name "HHH" tells
me nothing about what it's supposed to do. Without knowing what
HHH is, I can't say much about your code (or is it pseudo-code?).
>
For the purpose of this discussion HHH is exactly
what I said it is. It correctly simulates DDD.
Does HHH correctly simulate DDD *and do nothing else*?
Does HHH correctly simulate *every* function whose address is passed
to it? Must the passed function be one that takes no arguments
and does not return a value?
Can HHH just *call* the function whose address is passed to it?
If it's a correct simulation, there should be no difference between
calling the function and "correctly simulating" it.
My knowledge of C tells me nothing about *how* HHH might simulate
DDD.
We need not know anything else about HHH to
know that DDD correctly simulated by HHH cannot
possibly REACH its own "return" instruction.
Assuming that HHH(DDD) "correctly simulates" DDD, and assuming it
does nothing else, your code would be equivalent to this:
void DDD(void) {
DDD();
return;
}
Then the return statement (which is unnecessary anyway) will never be
reached. In practice, the program will likely crash due to a stack
overflow, unless the compiler implements tail-call optimization, in
which case the program might just run forever -- which also means the
unnecessary return statement will never be reached.
This conclusion relies on my understanding of what you've said about
your code, which I consider to be unreliable.
No doubt you believe that there is some significance to the
apparent fact that the return statement will never be reached,
assuming that's a correct and relevant conclusion. I don't know
what that significance might be.
The return statement is harmless but unnecessary.
"void DDD()" should be "void DDD(void)" (unless you're using C23,
but
we've established that your not). Why did you choose to use empty
parentheses? (If you answer nothing else, please answer that.)
>
I am using Microsoft Visual Studio 2017.
It compiled cleanly.
Microsoft Visual Studio 2017 is not a conforming C compiler. It has
options that cause it to attempt to be one. You are feeding it
incorrect code, and it's failing to diagnose it. Your code would
also compile cleanly if you fixed the errors. *Correct* C code
might be part of a more valid argument for your claims than the
one you're making. *Incorrect* C code hurts your credibility,
something I thought you cared about. (Using C at all is an odd
choice, but I won't get into that.)
If there were a refutation of the proof of the insolubility of the
Halting Problem, I do not believe it would really depend on the
vagaries of the 2017 version of Microsoft Visual Studio.
Oh, and I'm very likely to tire of this discussion very soon, so
think carefully if you want to make a point that you'd like me to
pay attention to. Among other things, your repeated insults against
people who dare to disagree with you do not motivate me to engage
with you. I probably shouldn't have jumped into this discussion,
but the noise level here is already so high I don't feel very bad
about it.
-- Keith Thompson (The_Other_Keith) Keith.S.Thompson+u@gmail.comvoid Void(void) { Void(); } /* The recursive call of the void */