找回密码
 注册
关于网站域名变更的通知
查看: 422|回复: 1
打印 上一主题 下一主题

常见gcc编译警告整理以及解决方法【收藏】

[复制链接]

该用户从未签到

跳转到指定楼层
1#
发表于 2019-2-20 13:16 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式

EDA365欢迎您登录!

您需要 登录 才可以下载或查看,没有帐号?注册

x
常见gcc编译警告整理以及解决方法【收藏】
* V- w  f5 R" T  u
7 e. R! I5 j+ e6 N+ \4 [
1、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的文件展开后,前一个文件的最后一行与后一个文件的第一行直接被连接成一行从而造成错误。
2、warning: comparison between pointer and integer
解释:integer与pointer比较
3、 warning: assignment discards qualifiers from pointer target type
解释:赋值时,取消了右值的限定。
游客,如果您要查看本帖隐藏内容请回复
9 C: T4 E( N& A( G! P3 l

该用户从未签到

2#
发表于 2019-2-20 22:42 | 只看该作者
看看,群主收藏了哦
您需要登录后才可以回帖 登录 | 注册

本版积分规则

关闭

推荐内容上一条 /1 下一条

EDA365公众号

关于我们|手机版|EDA365电子论坛网 ( 粤ICP备18020198号-1 )

GMT+8, 2025-6-16 01:12 , Processed in 0.078125 second(s), 23 queries , Gzip On.

深圳市墨知创新科技有限公司

地址:深圳市南山区科技生态园2栋A座805 电话:19926409050

快速回复 返回顶部 返回列表