This is the mail archive of the libc-hacker@sources.redhat.com mailing list for the glibc project.

Note that libc-hacker is a closed list. You may look at the archives of this list, but subscription and posting are not open.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: makecontext and its arguments


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."


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]