Re: Bug#504699: (no subject)
How would folk feel about the addition of the following test under
NOTES? Are the staments about x86-64 accurate?
On architectures where int and pointer types are the same
size (e.g., x86-32, where both types are 32 bits), you
may be able to get away with passing pointers as argu-
ments to makecontext() following argc. However, doing
this is not guaranteed to be portable, is undefined
according to the standards, and won't work on architec-
tures where pointers are larger than ints. Nevertheless,
starting with version 2.8 glibc makes some changes to
makecontext(3), to permit this on some 64-bit architec-
tures (e.g., x86-64).
Cheers,
Michael
--- a/man3/makecontext.3
+++ b/man3/makecontext.3
@@ -113,6 +113,22 @@ to be used as the stack, regardless of the
direction of growth of
the stack.
Thus, it is not necessary for the user program to
worry about this direction.
+
+On architectures where
+.I int
+and pointer types are the same size
+(e.g., x86-32, where both types are 32 bits),
+you may be able to get away with passing pointers as arguments to
+.BR makecontext ()
+following
+.IR argc .
+However, doing this is not guaranteed to be portable,
+is undefined according to the standards,
+and won't work on architectures where pointers are larger than
+.IR int s.
+Nevertheless, starting with version 2.8 glibc makes some changes to
+.BR makecontext (3),
+to permit this on some 64-bit architectures (e.g., x86-64).
.SH EXAMPLE
.PP
The example program below demonstrates the use of
Reply to: