_______________________________________________
Do not post admin requests to the list. They will be ignored.
Darwin-dev mailing list (Darwin-dev(a)lists.apple.com)
Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/darwin-dev/site_archiver%40lists.ap…
This email sent to site_archiver(a)lists.apple.com
Such macro MUST be defined before inclusion of any header. Moreover it should be defined to the value 600.
>From http://pubs.opengroup.org/onlinepubs/007904975/functions/xsh_chap02_02.html
“An XSI-conforming application should ensure that the feature test macro _XOPEN_SOURCE is defined with the value 600 before inclusion of any header. ”
Le 19 sept. 2013 à 20:08, Sidney San Martín <sidney(a)s4y.us> a écrit :
> Check out this C++ program:
>
> // #include <iostream>
>
> #define _XOPEN_SOURCE 1
> #include <ucontext.h>
>
> int main () {
> printf("sizeof(ucontext_t) -> %ld\n", sizeof(ucontext_t));
> }
>
> On my machine, it prints "768" (big ol' CPU). But, if I uncomment
> "#include <iostream>" and recompile, it prints "56". In practice, this
> makes getcontext() and the like overrun ucontext_t structs and stomp
> on other memory.
>
> If I define _XOPEN_SOURCE *before* I include iostream, ucontext_t is
> the right size. What's going on here?
> _______________________________________________
> Do not post admin requests to the list. They will be ignored.
> Darwin-dev mailing list (Darwin-dev(a)lists.apple.com)
> Help/Unsubscribe/Update your Subscription:
> https://lists.apple.com/mailman/options/darwin-dev/devlists%40shadowlab.org
>
> This email sent to devlists(a)shadowlab.org
-- Jean-Daniel
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Darwin-dev mailing list (Darwin-dev(a)lists.apple.com)
Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/darwin-dev/site_archiver%40lists.ap…
This email sent to site_archiver(a)lists.apple.com
Check out this C++ program:
// #include <iostream>
#define _XOPEN_SOURCE 1
#include <ucontext.h>
int main () {
printf("sizeof(ucontext_t) -> %ld\n", sizeof(ucontext_t));
}
On my machine, it prints "768" (big ol' CPU). But, if I uncomment
"#include <iostream>" and recompile, it prints "56". In practice, this
makes getcontext() and the like overrun ucontext_t structs and stomp
on other memory.
If I define _XOPEN_SOURCE *before* I include iostream, ucontext_t is
the right size. What's going on here?
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Darwin-dev mailing list (Darwin-dev(a)lists.apple.com)
Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/darwin-dev/site_archiver%40lists.ap…
This email sent to site_archiver(a)lists.apple.com