storage size of ‘oldact’ isn’t known
来源:互联网 发布:男生护肤品 知乎 编辑:程序博客网 时间:2024/06/01 13:04
#include <signal.h>
int main()
{
struct sigaction act, oldact;
return 0;
}
dies with the message
testgcc4.c: In function ‘main’:
testgcc4.c:6: error: storage size of ‘act’ isn’t known
testgcc4.c:6: error: storage size of ‘oldact’ isn’t known
if I use -std=c99 or --ansi?
gcc testgcc4.c compiles without problem but adding -std=c99 or --ansi produces
the error message above (for any of gcc-3.4, gcc-4.0, gcc-4.1) but neither
icc nor gcc on FreeBSD has a problem with -std=c99 or --ansi
Sumarry:
use -std=gnu99 on linux if you need some C99 functions (e.g. strtof) but also want to use functions like sigaction and strtok_r
gcc on linux is stricter than gcc on FreeBSD (or icc on either FreeBSD or linux) concerning standards.
gcc -std=c99 on linux means: *only* recognize functions specified in the standard (no sigaction, no strtok_r etc)
gcc -std=c99 on FreeBSD or icc -std=c99 on either FreeBSD or linux means recognize functions specified in the standard. This corresponds more or less to -std=gnu99 on linux
PS. This trap seems to be quite common (e.g. discussions on debian-glibc about the "fact" that strtof is completely broken on linux). I would be grateful if somebody could point me to a good overview describing what standards compliance means for various OS/compiler+options/standards combinations.
- storage size of ‘oldact’ isn’t known
- storage size of 'a' isn't known
- storage size of ‘XXX’ isn’t known
- storage size of `seraddr' isn't known #include
- error: storage size of 'rq' isn't known 正解
- error storage size of 'pwbuf' isn't known
- error: storage size of ‘server_addr’ isn’t known
- error: storage size of ‘md_ctx’ isn’t known
- storage size of 'value' isn't known问题出现的可能原因
- recv_image.c:129 : error: storage size of 'rq' isn't known
- error: storage size of ‘rlimit_fsize’ isn’t known struct rlimit rlimit_fsize;
- linux c TCP/IP 编译问题 error: storage size of ‘addrCriteria’ isn’t known解决办法
- C/C++ error: storage size of ‘tv’ isn’t known错误解决方法
- linux c TCP/IP 编译问题 error: storage size of ‘addrCriteria’ isn’t known解决办法
- storage size of 'value' isn't known问题出现的可能原因之一
- error: storage size of ‘timeout’ isn’t known struct timeval timeout
- andorid编译报错serve_image.c:32:18: error: storage size of ‘hints’ isn’t known
- 报错storage size of ‘act’ isn’t known当使用std=c99编译struct sigaction
- PHP函数 替换指定出现次数的子字符串
- java创建文件保存为utf-8
- UILabel
- Windows下的IIS日志管理
- NGUI官方实例—ControlIerInput讲解
- storage size of ‘oldact’ isn’t known
- NGUI Example5 示例讲解– lights and Refraction
- Yii Framework 开发教程(20) UI 组件 Captcha示例
- Java发送http请求 (get 与 post方法请求)
- 谦逊、踏实的低头做事,每日反思。——送给自己。
- Android得到状态栏和标题栏的高度
- 如何遍历memcached里面所有key的命令
- NGUI官网示例6 – Draggable Window讲解(一)
- NSDictionary 和 NSArray