I have this minimal helloworld, extended with an include of ucontext.h
:
#include <ucontext.h>
#include <stdio.h>
int main(int argc, char** argv) {
printf ("hello world!\n");
return 0;
}
It compiles without warning with gcc-4.9 (gcc -c hw.c -Wall
).
But if I switch to the c11 standard (gcc -std=c11 -c hw.c -Wall
), I get the following error:
$ gcc -std=c11 -c hw.c -Wall
In file included from /usr/include/ucontext.h:26:0,
from hw.c:1:
/usr/include/x86_64-linux-gnu/sys/ucontext.h:137:5: error: unknown type name ‘stack_t’
stack_t uc_stack;
^
My first idea is that glibc doesn't support c11. Googling for that didn't reveal usable information. What is the case?
(I use glibc-2.19 with gcc-4.9. It is a debian jessie, amd64.)