makecontext and its arguments
Andreas Schwab
schwab@suse.de
Mon Aug 5 04:50:00 GMT 2002
Andreas Jaeger <aj@suse.de> writes:
|> Implementing makecontext on x86-64 I noticed a problem with passing
|> its arguments.
|>
|> The function is defined as:
|> void makecontext(ucontext_t *ucp, void (*func)(void),
|> int argc, ...);
|>
|> There's no way to determine the type of the arguments.
|>
|> The Austin Draft (and also our manual) mentions:
|>
|> The application shall ensure that the value of argc matches the
|> number of integer arguments passed to func; otherwise, the
|> behavior is undefined.
IMHO this is a defect in the standard, because "integer" can mean
anything from char to long long and whatever extended integer type might
be defined. It does not restrict the arguments to type "int".
Andreas.
--
Andreas Schwab, SuSE Labs, schwab@suse.de
SuSE Linux AG, Deutschherrnstr. 15-19, D-90429 Nürnberg
Key fingerprint = 58CA 54C7 6D53 942B 1756 01D3 44D5 214B 8276 4ED5
"And now for something completely different."
More information about the Libc-hacker
mailing list