1 error: expected expression before 'else'

else之前无表达式。

2 error:
lvalue required as left operand of assignment

左值问题。

3 error:
invalid storage class for function 'XXXXXX'

在文件的某个地方,丢失了一个大括号‘}’。

常见gcc编译警告整理(开始)

、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编译警告和错误的更多相关文章

  1. Linux GCC编译警告:Clock skew detected. 错误解决办法

    今天在虚拟机上用GCC编译一个程序的时候,出现了下面的错误: make: warning: Clock skew detected. Your build may be incomplete 试了ma ...

  2. GCC编译警告选项总结

    一 前言 GCC有很多的编译选项,警告选项:指定头文件.库路径:优化选项.本文针整理一下GCC的警告选项,主要依据http://gcc.gnu.org/onlinedocs/gcc/Warning-O ...

  3. ios5 xcode 4.2 中 release显示编译警告或错误的解决方法

    转自:http://lizi464789754.blog.163.com/blog/static/1689370852011924113245778/ 由于 iOS5 xcode4.2 引入了ARC ...

  4. gcc编译代码报错及编译方式

    一.error: 'for' loop initial declarations are only allowed in C99 mode 前段时间写了一个小C程序,放在linux下用gcc编译出错, ...

  5. gcc编译把警告都输出成错误

    -Werror 把所有警告转换为错误,以在警告发生时中止编译过程

  6. C++常见gcc编译链接错误解决方法

    除非明确说明,本文内容仅针对x86/x86_64的Linux开发环境,有朋友说baidu不到,开个贴记录一下(加粗字体是关键词): 用“-Wl,-Bstatic”指定链接静态库,使用“-Wl,-Bdy ...

  7. paip.提升用户体验---c++ qt 取消gcc编译的警告信息.txt

    paip.提升用户体验---c++ qt 取消gcc编译的警告信息.txt 作者Attilax ,  EMAIL:1466519819@qq.com  来源:attilax的专栏 地址:http:// ...

  8. gcc编译通过,运行却显示“段错误”的解决方法

    ​第一次在Liunx上(liunx mint 17)使用gcc编译c文件,竟然提示“找不到stdio.h",经过google后发现执行 sudo apt-get install build- ...

  9. GCC编译错误小结

    gcc编译时对’xxxx’未定义的引用问题可能错误 错误一: 没有实现xxxx 错误二: c++引用c语言so库,但是so库头文件没有extern "C" 错误三: 检查各个共享库 ...

随机推荐

  1. C++ 文件读写方案选型

    严格来说, 有 3 种风格. UNIX 底层读写库 c 语言 stdio 标准库 iostream 流 一般的工程中, 底层读写库封装程度太低, 需要自己处理缓存和很多通用的异常场景. 不适合. 网络 ...

  2. Poj OpenJudge 百练 2389 Bull Math

    1.Link: http://poj.org/problem?id=2389 http://bailian.openjudge.cn/practice/2389/ 2.Content: Bull Ma ...

  3. 关于fputs和fgets的几个细节

    C语言中两个标准IO fputs和fgets都是针对行来进行数据的读取的!这里关于这两个IO函数我有几个小细节想在这里和大家分享一下,希望能够对大家产生帮助! 首先贴上这两个函数的函数声明,下面以这两 ...

  4. web浏览器下的缓存 - Etag

    设置浏览器缓存的几种方法: Last-Modified : 服务器上文件的最后修改时间 Etag  : 文件标识 Expiers : 本地缓存目录中文件过期的时间 ( 由服务器指定具体的时间 ) Ca ...

  5. HTTP Header 详解【转】

    原文出自:http://kb.cnblogs.com/page/92320/ HTTP(HyperTextTransferProtocol)即超文本传输协议,目前网页传输的的通用协议.HTTP协议采用 ...

  6. 6个好用的Web开发工具

    在过去的几年间,涌现出了很多Web开发工具,它们大多还是比较吸引人的,方便了我们的工作.我们可以学习一下这些新东西,短时间就可以拓宽思路(PHP100推荐:学习10分钟,改变你的程序员生涯).这些应用 ...

  7. xml学习总结(二)

    XML Schema (1)Schema内置类型 ->字符串类型 <strlist xmlns:xsi="http://www.w3.org/2001/XMLSchema-ins ...

  8. PHP - PDO 之 mysql 基础操作

    <?php /* pdo 学习 */ $dsn = 'mysql:host=localhost;dbname=cswl';//构建连接dsn $db = new pdo($dsn,'root', ...

  9. php源代码安装常见错误与解决办法分享

    错误:configure: error: libevent >= 1.4.11 could not be found 解决:yum -y install libevent libevent-de ...

  10. Unity3d插件iTween的使用

    iTween.cs 下载地址:http://pan.ceeger.com/viewfile.php?file_id=1830&file_key=0UJAymOJ 版本为2.0.43 一.iTw ...