CBFalconer said:
Without that, at some point, the linking step will not function,
and you don't get an executable.
You have failed to cite the section of the Standard that requires the
source code of a called function to be present at compilation. Am I to
assume that you can't find the section? Neither can I.
Addressing your non sequitur, however, consider the following code:
#include <stdio.h>
int main(void)
{
printf("Hello, world.\n");
return 0;
}
I have used implementations that don't ship their libraries in source form,
and yet the call to printf works just fine, and I *do* get an executable
program. So your non sequitur appears to be incorrect.
Existence of valid code for the routine.
So if the valid code exists, that's okay? Good. Nobody said it had to be
written in C. The standard library doesn't have to be written in C.
Implementation extensions (which are legal, according to the Standard)
don't have to be written in C.
I've noticed that you often say something like this when you don't really
understand what I'm getting at. In this case, my point is simple enough -
*at compilation*, it is not necessary for a function's C source to be
visible (or even to exist) for the call to that function to be compiled
correctly. And at link time, it is only necessary for the object code to
be present in the appropriate form for linking. The Standard imposes no
requirement for the object code to have been generated from C code.
Clearly, a function that is specific to a particular implementation is
non-portable (at least in object code form) - but the point of this
discussion is not whether the program is portable but whether it is
standard. The following program is standard, non-portable C:
#include <stdio.h>
#include <myplatform.h>
int main(void)
{
printf("%d\n", mynonportablefunction());
return 0;
}
whether or not the source code of mynonportablefunction() is available.
That does not, of course, make mynonportablefunction() topical here, but
neither is the program a priori non-standard.