[ntp:hackers] Segfaults in ntp-dev
Paul Vixie
paul at vix.com
Sun Jun 3 14:06:44 PDT 2007
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