[ntp:hackers] Segfaults in ntp-dev
David L. Mills
mills at udel.edu
Sun Jun 3 22:24:05 PDT 2007
Paul,
This is bogus. The original architecture of Algol 60 and eventually
Algol 68 was principle driven and well conceived. Nonsense creation of
structures by implication is evil. What happens if I record the pointers
and later attempt to free them? It might even work, but that is not an
appropriate architectural model.
Dave
Paul Vixie wrote:
> there's no reason in principle (given ANSI C as a requirement) why
> the function can't just return a struct timeval. the days when
> functions couldn't return aggregates are long long gone.
>
> [fh:amd64] cc -c -ansi mills-test.c
> [fh:amd64] cat mills-test.c
> #include <sys/time.h>
> #include <time.h>
>
> struct timeval
> mills_test(struct timeval input) {
> return input;
> }
>
> how a compiler decides to implement this, stack, register, heap, paper
> airplane, etc, is not a concern except when doing this in a kernel.
More information about the hackers
mailing list