Path: ...!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!eternal-september.org!.POSTED!not-for-mail From: olcott Newsgroups: comp.theory Subject: Re: Every sufficiently competent C programmer knows Date: Tue, 11 Mar 2025 13:54:20 -0500 Organization: A noiseless patient Spider Lines: 80 Message-ID: References: <473a9a152c792a48c83eea569551035994c9d04f@i2pn2.org> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit Injection-Date: Tue, 11 Mar 2025 19:54:20 +0100 (CET) Injection-Info: dont-email.me; posting-host="21ad3ceb157a21d404b41b865b615184"; logging-data="2239217"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19ZtX4d+jcnMYcdaR5K9MoW" User-Agent: Mozilla Thunderbird Cancel-Lock: sha1:sSvX8KJ8EHMkS0lfpbLS4lb6Bn8= Content-Language: en-US X-Antivirus-Status: Clean In-Reply-To: X-Antivirus: Norton (VPS 250311-4, 3/11/2025), Outbound message Bytes: 3800 On 3/11/2025 8:58 AM, Mikko wrote: > On 2025-03-11 13:34:34 +0000, olcott said: > >> On 3/11/2025 5:30 AM, Mikko wrote: >>> On 2025-03-11 02:27:42 +0000, olcott said: >>> >>>> On 3/10/2025 9:21 PM, Richard Damon wrote: >>>>> On 3/10/25 7:41 PM, olcott wrote: >>>>>> typedef void (*ptr)(); >>>>>> int HHH(ptr P); >>>>>> >>>>>> void Infinite_Loop() >>>>>> { >>>>>>    HERE: goto HERE; >>>>>>    return; >>>>>> } >>>>>> >>>>>> void Infinite_Recursion() >>>>>> { >>>>>>    Infinite_Recursion(); >>>>>>    return; >>>>>> } >>>>>> >>>>>> void DDD() >>>>>> { >>>>>>    HHH(DDD); >>>>>>    return; >>>>>> } >>>>>> >>>>>> int DD() >>>>>> { >>>>>>    int Halt_Status = HHH(DD); >>>>>>    if (Halt_Status) >>>>>>      HERE: goto HERE; >>>>>>    return Halt_Status; >>>>>> } >>>>>> >>>>>> That when HHH correctly emulates N steps of the >>>>>> above functions that none of these functions can >>>>>> possibly reach their own "return" instruction >>>>>> and terminate normally. >>>>>> >>>>>> Since HHH does see that same pattern that competent >>>>>> C programmers see it correctly aborts its emulation >>>>>> and rejects these inputs as non terminating. >>>>>> >>>>> >>>>> Problem: DD Isn't a program, and if you try to compile it, you will >>>>> get an undiefined symbol HHH. >>>> >>>> HHH need not be a program for this correct thought experiment. >>>> The only detail required to know about HHH is that it correctly >>>> emulates N steps of DD. >>> >>> Wrong. One nneds also to know how a call to HHH is interpreted, in >>> particular >>> if HHH is not a program. >> >> You are trying to get away with saying that >> one C function cannot call another C function >> according to the semantics of the C language? > > You are trying to get away with a distraction by lying? > > Calling is possible if the functions are in the same file or if they > are linked together and the called function is global. > > What is not possible is to determine the consequnces of such call > without knowing enough about the called function. As you would > know if you knew anything about programming. > I specified that the functions are correctly emulated by HHH (by whatever means) and added that for HHH(DD) and HHH(DDD) HHH does emulate itself emulating these inputs to an arbitrary recursive depth. -- Copyright 2025 Olcott "Talent hits a target no one else can hit; Genius hits a target no one else can see." Arthur Schopenhauer