Sujet : Re: Every sufficiently competent C programmer knows --- Semantic Property of Finite String
De : rjh (at) *nospam* cpax.org.uk (Richard Heathfield)
Groupes : comp.theoryDate : 14. Mar 2025, 15:49:00
Autres entêtes
Organisation : Fix this later
Message-ID : <vr1fks$1frcd$2@dont-email.me>
References : 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18
User-Agent : Mozilla Thunderbird
On 14/03/2025 14:10, Richard Damon wrote:
On 3/13/25 11:55 PM, olcott wrote:
<snip>
In other words you are stupidly trying
to get away with saying that it is impossible
for one C function to call another C function.
>
Not at all, just that for a C function to call another C function that other C function must be included as part of the Program that the first is defined in.
This is an easy area for ambiguity. In this code:
int bar(void);
int foo(void)
{
return bar();
}
bar() is not included, merely prototyped, but it is reasonable to say that foo() is (syntactically) calling bar(). It is /not/ reasonable, though, to claim that we know what foo() will do unless we know for sure what bar() does. And neither is it possible for foo()'s program to run if bar()'s source is not in the module and cannot be tracked down elsewhere by the linker.
The absence of bar() from ready availability does not mean that foo() isn't calling bar(). It only means that bar() might not be around to hear.
As is so often the case, whether we're right to claim X depends on what we mean by X.
C functions are not programs, but programs can be built from C functions,
True, although I think one would have to be pretty tight to insist on the distinction in this case.
If we can think of C functions as programs, we don't need to emulate anything at all (not that we did, of course); we can just call the function and catch its return vale (if any).
That is like asking what is the frequency of a square?
I have it on good authority that squares broadcast on 4Hz.
-- Richard HeathfieldEmail: rjh at cpax dot org dot uk"Usenet is a strange place" - dmr 29 July 1999Sig line 4 vacant - apply within