自定义博客皮肤VIP专享

*博客头图:

格式为PNG、JPG,宽度*高度大于1920*100像素,不超过2MB,主视觉建议放在右侧,请参照线上博客头图

请上传大于1920*100像素的图片!

博客底图:

图片格式为PNG、JPG,不超过1MB,可上下左右平铺至整个背景

栏目图:

图片格式为PNG、JPG,图片宽度*高度为300*38像素,不超过0.5MB

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+
  • 博客(5)
  • 收藏
  • 关注

原创 gcc的返回值

不加-Wall参数的情况或多路返回情况下,gcc默认不对未写返回语句的情况作处理。如:int func(){}int main(void){printf("%d\n", func());}编译正常。一般来说,如果返回值在四个字节以内,就会使用eax寄存器返回。而return语句就是将返回值写入eax。调用者到eax寄存器中取返回值。因此,在缺失r

2013-06-10 19:04:53 1760

原创 gcc的隐式调用

gcc语法检验不严格。gcc并不对未声明的函数编译时报错,它会认为第一次遇到的func是属于隐式声明int func();链接时会与链接库或其他目标文件中的函数原型比较,如果不兼容,就警告,例如:stack.c:115:3: 警告: 隐式声明与内建函数‘exit’不兼容 [默认启用]。

2013-06-10 18:27:08 995

转载 gcc c 在for语句中声明变量需要编译时加“-std=c99”

http://gcc.gnu.org/ml/gcc-patches/2000-11/msg00913.htmlPatch for C99 "for (int i = 0; i To: Subject: Patch for C99 "for (int i = 0; i From: "Joseph S. Myers" Date: Sat, 18 Nov 2000 22:23:36 +0

2013-06-10 14:52:40 4724

原创 gcc c 关于结构体对齐

-Wpacked           Warn if a structure is given the packed attribute, but the packed           attribute has no effect on the layout or size of the structure.           Such structures may be mi

2013-06-10 14:34:23 1370

原创 gcc 关于隐式初始化的选项说明

-Wmaybe-uninitialized           For an automatic variable, if there exists a path from the function           entry to a use of the variable that is initialized, but there exist           some o

2013-06-10 14:28:20 857

空空如也

空空如也

TA创建的收藏夹 TA关注的收藏夹

TA关注的人

提示
确定要删除当前文章?
取消 删除