GCC编译警告和错误
1 error: expected expression before 'else'
else之前无表达式。
2 error:
lvalue required as left operand of assignment
左值问题。
3 error:
invalid storage class for function 'XXXXXX'
在文件的某个地方,丢失了一个大括号‘}’。
、warning:
no newline at end of file
在文件最后一行加上回车键
解释:在《Rationale
for the C99 standard》一文中,有C99的相关信息:
A
backslash immediately before a newline has long been used to continue
string literals, as well as preprocessing command lines. In the
interest of easing machine generation of C, and of transporting code
to machines with restrictive physical line lengths, the C89 Committee
generalized this mechanism to permit any token to be continued by
interposing a backslash/newline
sequence.
c/c++代码的每一行后面有一个“结束符”,也就是newline。避免当被include的文件展开后,前一个文件的最后一行与后一个文件的第一行直接被连接成一行从而造成错误。
、warning:
comparison between pointer and integer
解释:integer与pointer比较
、 warning:
assignment discards qualifiers from pointer target type
解释:赋值时,取消了右值的限定。
、 warning:
passing argument 1 of 'send' makes pointer from integer without a
cast
解释:函数send的第一个integer型参数没有强制转换为pointer型
、warning:
comparison is always true due to limited range of data type
解释:由于数据类型范围的限制,比较结果一直为真。
、warning:
initialization from incompatible pointer type
解释:不兼容指针类型的初始化
、 warning:
return makes pointer from integer without a cast
解释:return使integer转换为pointer,没有加强制类型转换。
、warning:
incompatible implicit declaration of built-in function 'printf'
解释:与内置的printf函数隐士声明不兼容。
、warning:
initialization discards qualifiers from pointer target type
解释:initialization取消了指针目标类型的限定。
、warning:
comparison is always false due to limited range of data type
由于类型限制,比较一直是假
、warning:
assignment from incompatible pointer type
不兼容的指针间赋值
12、warning:
passing argument 1 of 'mes_read_time' discards qualifiers from
pointer target type12、
mes_函数第一个参数的传递,丢弃了指针目标类型限定。
、warning:
"protocol_type" redefined
——type重定义
14、warning:
'return' with a value, in function returning void
在void返回类型的函数中,return返回值。
GCC编译警告和错误的更多相关文章
- Linux GCC编译警告:Clock skew detected. 错误解决办法
今天在虚拟机上用GCC编译一个程序的时候,出现了下面的错误: make: warning: Clock skew detected. Your build may be incomplete 试了ma ...
- GCC编译警告选项总结
一 前言 GCC有很多的编译选项,警告选项:指定头文件.库路径:优化选项.本文针整理一下GCC的警告选项,主要依据http://gcc.gnu.org/onlinedocs/gcc/Warning-O ...
- ios5 xcode 4.2 中 release显示编译警告或错误的解决方法
转自:http://lizi464789754.blog.163.com/blog/static/1689370852011924113245778/ 由于 iOS5 xcode4.2 引入了ARC ...
- gcc编译代码报错及编译方式
一.error: 'for' loop initial declarations are only allowed in C99 mode 前段时间写了一个小C程序,放在linux下用gcc编译出错, ...
- gcc编译把警告都输出成错误
-Werror 把所有警告转换为错误,以在警告发生时中止编译过程
- C++常见gcc编译链接错误解决方法
除非明确说明,本文内容仅针对x86/x86_64的Linux开发环境,有朋友说baidu不到,开个贴记录一下(加粗字体是关键词): 用“-Wl,-Bstatic”指定链接静态库,使用“-Wl,-Bdy ...
- paip.提升用户体验---c++ qt 取消gcc编译的警告信息.txt
paip.提升用户体验---c++ qt 取消gcc编译的警告信息.txt 作者Attilax , EMAIL:1466519819@qq.com 来源:attilax的专栏 地址:http:// ...
- gcc编译通过,运行却显示“段错误”的解决方法
第一次在Liunx上(liunx mint 17)使用gcc编译c文件,竟然提示“找不到stdio.h",经过google后发现执行 sudo apt-get install build- ...
- GCC编译错误小结
gcc编译时对’xxxx’未定义的引用问题可能错误 错误一: 没有实现xxxx 错误二: c++引用c语言so库,但是so库头文件没有extern "C" 错误三: 检查各个共享库 ...
随机推荐
- C#编写记事本(高仿)
近一周写的关于记事本的代码,高仿记事本.本人C#入门不久,其中存在代码冗余,但懒得修改了. 经测试运行正常. 一.主窗体设计及代码 namespace BestEditor { public part ...
- Winform ComboBox控件高亮显示
//重绘下拉表单窗口,需要在窗口设计代码中加入下面这一句 this.cmdChannelName.DrawMode = System.Windows.Forms.DrawMode.OwnerDrawF ...
- ES6学习笔记(三)
ES6加强了对Unicode的支持,并且扩展了字符串对象. 1.字符的Unicode表示法 JavaScript允许采用\uxxxx形式表示一个字符,其中"xxxx"表示字符的码点 ...
- 在win7上建立本地FTP站点详细步骤
一.安装FTP组件点击:控制面板—>程序和功能—>打开或关闭Windows功能. 勾选“FTP服务器”及“FTP服务”“FTP扩展性”,点击“确定”,安装FTP组件. 勾选Web管理工具的 ...
- lazy instructor
Description A math instructor is too lazy to grade a question in the exam papers in which students a ...
- ubuntu find方法
通用格式:find pathname -options [-print -exec -ok]例子:find / -name filename 再根目录里面搜索文件名为filename的文件find / ...
- sysfs接口整理
SYS节点 目录结构: 1:sysfs相关知识点介绍(介绍sysfs的体系结构) 2:sys节点核心知识(使用sys节点核心的知识) 3:代码实例(创建sys节点的代码实例) 1:sysfs相关知识点 ...
- filter_map
#!/usr/bin/env python # -*- coding:utf-8 -*- ret = filter( lambda x: x < 3, [1, 2, 3, 4, 5]) prin ...
- 基于Ogre的DeferredShading(延迟渲染)的实现以及应用
http://blog.sina.com.cn/s/blog_458f871201017i06.html 这篇文章写的不错,从比较宏观的角度说了下作者在OGRE中实现的延迟渲染
- java多态与异常处理——动手动脑
编写一个程序,此程序在运行时要求用户输入一个 整数,代表某门课的考试成绩,程序接着给出“不及格”.“及格”.“中”.“良”.“优”的结论. 要求程序必须具备足够的健壮性,不管用户输入什 么样的内容,都 ...