storage size of ‘oldact’ isn’t known
#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的更多相关文章
- storage size of 'xxx' isn't known问题出现的可能原因之一
storage size of 'value' isn't known问题出现的可能原因之一 有可能是头文件没有包含起来,所以会出现这种问题可以从以下几个方面来查找原因:1.若是结构体类型,类型是否写 ...
- error storage size of my_addr isn't known
- 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结构体未知,原因是相应 ...
- DELPHI设置枚举类型size
delphi枚举类型长度默认为2个字节(单字),而在C中枚举为4个字节(双字),如果需要跨这两个平台编程,传输结构时会由于数据长度不一造成灾难. 经过查找资料,原来delphi可以通过{$Z+} {$ ...
- How to reduce Index size on disk?减少ES索引大小的一些小手段
ES索引文件瘦身总结如下: 原始数据:(1)学习splunk,原始data存big string(2)原始文件还可以再度压缩倒排索引:(1)去掉不必要的倒排索引信息:例如文件位置倒排._source和 ...
- C++ std::array
std::array template < class T, size_t N > class array; Code Example #include <iostream> ...
- Java:泛型基础
泛型 引入泛型 传统编写的限制: 在Java中一般的类和方法,只能使用具体的类型,要么是基本数据类型,要么是自定义类型.如果要编写可以应用于多种类型的代码,这种刻板的限制就会束缚很多! 解决这种限制的 ...
- C++程序设计基础
01 1 预编译常用的有,宏定义和包含库.2 库:是实用工具的集和,由程序员编写,可以完成一些特定的功能.3 <> 系统库 ""用户自定义库.4 宏定义:定义符号常量, ...
- 自制编程语言crowbar(v0.1)构建解析器时分配内存
crowbar中第一次申请内存是在生成解析器的时候: /* interface.c */CRB_Interpreter *CRB_create_interpreter(void) { MEM_Stor ...
随机推荐
- gmail邮箱怎么批量删除邮件
转载:http://jingyan.baidu.com/article/9f7e7ec056cbcd6f2815543c.html 首先打开gmail邮箱,随便打开一封邮件,找到发件人邮件地址,复制, ...
- IOS常用加密GTMBase64
GTMDefines.h // // GTMDefines.h // // Copyright 2008 Google Inc. // // Licensed under the Apache Lic ...
- Temporary-Post-Used-For-Style-Detection-Title-1901742601
Temporary-Post-Used-For-Style-Detection-Content-1901742601
- 【CentOS】搭建Web服务器
参考资料: http://www.paipat.com/?post=24 http://www.cnblogs.com/xiaoluo501395377/archive/2013/04 ...
- js中常用数组方法concat join push pop slice splice shift
javascript给我们很多常用的 数组方法,极大方便了我们做程序.下面我们来介绍下常用的集中数组方法. 比如 concat() join() push() pop() unshift() shif ...
- 转载淘宝UED响应十日谈
响应式十日谈:楔子 响应式十日谈第一日:使用 rem 设置文字大小
- 批量安装操作系统之cobbler
Cobbler 部署文档 服务端配置 操作系统:Centos6.4 关闭防火墙及 selinux 安装cobbler软件 添加yum源 rpm -Uvh https://dl.fedoraprojec ...
- ASP.Net 上传进度条的实现方法
对于加载时间比较长的ASP.NET页面,我们可以在客户端浏览器中显示进度条来显示页面正在装载.下面就是具体的实现过程: 新建项目,名字为WebPortal,在项目类型中选择Visual C#项目或者V ...
- centos mysql 操作
安装mysqlyum -y install mysql-server 修改mysql配置 vi /etc/my.cnf 这里会有很多需要注意的配置项,后面会有专门的笔记 暂时修改一下编码(添加在密码下 ...
- zend studio 快捷键收集
Ctrl + / 单行注释 Ctrl + Shift + / 添加块注释 Ctrl + Shift + \ 移除块注释 Ctrl + Shift + F 调整代码格式 Ctr ...