I want to use popen. It is in stdio.h. I include that, but the compiler doesn't see it with -std=c11. It does compile without -std=c11.
#include <stdio.h>
int main(void)
{
popen("ls *","r");
}
gcc -std=c11 popen_test.c
popen_test.c: In function ‘main’:
popen_test.c:5:4: warning: implicit declaration of function ‘popen’ [-Wimplicit-function-declaration]
popen("ls *","r"); ^~~~~
It is hidden in stdio.h with
#ifdef __USE_POSIX2
The man page says it is available if:
_POSIX_C_SOURCE >= 2 || /* Glibc versions <= 2.19: */ _BSD_SOURCE || _SVID_SOURCE