Con*_*yer 22
你可能想要-std=gnu99而不是-std=c99.C99模式明确禁用(大多数)GNU扩展.
我写了一个简单的测试:
#include <sys/mman.h>
int a = MAP_ANONYMOUS;
Run Code Online (Sandbox Code Playgroud)
在C99模式下,它找不到值:
$ gcc -std=c99 -c d.c
d.c:3:9: error: ‘MAP_ANONYMOUS’ undeclared here (not in a function)
Run Code Online (Sandbox Code Playgroud)
而在Gnu99模式中,它确实:
$ gcc -std=gnu99 -c d.c
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
10411 次 |
| 最近记录: |