I have an application that uses the mmap system call, I was having an issue getting it to compile for hours looking as to why I was getting MAP_ANON and MAP_ANONYMOUS were undec
You probably want -std=gnu99
instead of -std=c99
. C99 mode explicitly disables (most) GNU extensions.
I wrote a simple test:
#include <sys/mman.h>
int a = MAP_ANONYMOUS;
In C99 mode, it doesn't find the value:
$ gcc -std=c99 -c d.c
d.c:3:9: error: ‘MAP_ANONYMOUS’ undeclared here (not in a function)
Whereas in Gnu99 mode, it does:
$ gcc -std=gnu99 -c d.c