MAP_ANONYMOUS with C99 standard

我的梦境 提交于 2019-12-04 00:01:03

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
标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!