#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.

上面的代码使用-std=gnu99正常通过。

man gnu:

c99
c9x
iso9899:1999
iso9899:199x
ISO C99. Note that this standard is not yet fully supported; see <http://gcc.gnu.org/c99status.html> for
more information. The names c9x and iso9899:199x are deprecated.

gnu99
gnu9x
GNU dialect of ISO C99. When ISO C99 is fully implemented in GCC, this will become the default. The name
gnu9x is deprecated.

参考 :http://blog.csdn.net/cccallen/article/details/8440175

storage size of ‘oldact’ isn’t known的更多相关文章

  1. storage size of 'xxx' isn't known问题出现的可能原因之一

    storage size of 'value' isn't known问题出现的可能原因之一 有可能是头文件没有包含起来,所以会出现这种问题可以从以下几个方面来查找原因:1.若是结构体类型,类型是否写 ...

  2. error storage size of my_addr isn't known

  3. install busybox时报error: storage size of ‘rlimit_fsize’ isn’t known struct rlimit rlimit_fsize

    解决办法: 在busybox根目录下查找到文件:find -name libbb.h 在libbb.h.h中包含sys/resource.h 说明: 上述错误的原因是rlimit结构体未知,原因是相应 ...

  4. DELPHI设置枚举类型size

    delphi枚举类型长度默认为2个字节(单字),而在C中枚举为4个字节(双字),如果需要跨这两个平台编程,传输结构时会由于数据长度不一造成灾难. 经过查找资料,原来delphi可以通过{$Z+} {$ ...

  5. How to reduce Index size on disk?减少ES索引大小的一些小手段

    ES索引文件瘦身总结如下: 原始数据:(1)学习splunk,原始data存big string(2)原始文件还可以再度压缩倒排索引:(1)去掉不必要的倒排索引信息:例如文件位置倒排._source和 ...

  6. C++ std::array

    std::array template < class T, size_t N > class array; Code Example #include <iostream> ...

  7. Java:泛型基础

    泛型 引入泛型 传统编写的限制: 在Java中一般的类和方法,只能使用具体的类型,要么是基本数据类型,要么是自定义类型.如果要编写可以应用于多种类型的代码,这种刻板的限制就会束缚很多! 解决这种限制的 ...

  8. C++程序设计基础

    01 1 预编译常用的有,宏定义和包含库.2 库:是实用工具的集和,由程序员编写,可以完成一些特定的功能.3 <> 系统库 ""用户自定义库.4 宏定义:定义符号常量, ...

  9. 自制编程语言crowbar(v0.1)构建解析器时分配内存

    crowbar中第一次申请内存是在生成解析器的时候: /* interface.c */CRB_Interpreter *CRB_create_interpreter(void) { MEM_Stor ...

随机推荐

  1. solr简易安装配置

    之前弄了段时间的lucene,昨天下午开始学solr,准备用到项目中,在网上找了一些教程,有的不是讲得太复杂,就是讲得不在点上,花了不少冤枉时间.有的一上来就花过半的篇幅大讲特讲“3H”,(what, ...

  2. 1、android orm之greendao

    前提:最近写android项目,android自带数据库api有点复杂,于是偷懒用了greendao.greendao好处自己查,这里不赘述,但是零基础的的我用起来还是费了3天的功夫,取之于网络,特在 ...

  3. [百度空间] [转]关于Direct3D多窗口编程的一篇翻译

    Introduction In DirectX 8, support for rendering to multiple windows is provided through the creatio ...

  4. 引擎设计跟踪(九.14.2e) DelayLoaded DLLs (/DELAYLOAD)

    关于DLL的delay load: http://msdn.microsoft.com/en-us/library/151kt790.aspx 最近在做GLES的shader compiler, 把现 ...

  5. HDU1014Uniform Generator

    Uniform Generator Time Limit:1000MS     Memory Limit:32768KB     64bit IO Format:%I64d & %I64u   ...

  6. 【JQuery NoviceToNinja系列】目录

    [JQuery NoviceToNinja系列]目录 [JQuery NoviceToNinja系列]01 开篇 Html页面设计和布局

  7. ios 5

    1.屏幕尺寸568×2/320×2  需要一张568h@2x.png的图片. 2.iOS5不支持udid,用uuid替代,取得uuid方法: -(NSString*) uuid { CFUUIDRef ...

  8. Maven在项目中的应用

    http://192.168.0.253:8081/nexus/#view-repositories;thirdparty~uploadPanel 使用局域网搭建的环境,输入用户名和密码登录,上传ja ...

  9. Sqli-labs less 34

    Less-34 本关是post型的注入漏洞,同样的也是将post过来的内容进行了 ' \ 的处理.由上面的例子可以看到我们的方法就是将过滤函数添加的 \ 给吃掉.而get型的方式我们是以url形式提交 ...

  10. ubuntu 点点滴滴

    pptpd http://linux.cn/article-3376-1.html 命令行升级ubuntu版本 do-release-upgrade -d  寻找最新的稳定版本,加上-d参数则包括不稳 ...