32位linux平台和saloris平台compile warning总结参考
来源:互联网 发布:手机照片制作软件 编辑:程序博客网 时间:2024/06/05 04:04
编译器为gcc, 编译平台为32为linux 和 32位saloris平台,语言为C++与C混编
(1)unused variable and function
example:
xxx.cpp:54: warning: unused variable 'yyy'.
'BYTE func( INT4, char*)' defined but not used
原因可能是 1.在该变量作用域内该变量未被使用,或者,变量在以#ifdef /#if ndef ~ #endif内部使用。
2.该函数被声明为static,且未在被包含的文件中使用。
可能解决方法:
第一种情况,将未使用的变量删除,或者将变量的声明和定义写在对应的#ifdef /#if ndef ~ #endif内部。
第二种情况,删除未使用的函数,或者,在不出错的情况下,将static去掉。
(2)warning: invalid white space character in directive
example :
"xxx.cpp",line n: warning: invalid white space character in directive
原因可能是因为linux下的换行与windows下的换行符不相同造成的。
可能解决方法:在linux下使用dos2unix命令对文件进行转换。
(3)warning: implicit function declaration
example:"xxx.c", line n: warning: implicit function declaration: func1
原因可能是func1的参数没有找到多个对应的原型文件
可能解决方法:删除多余的头文件
(4)enumeration value 'xxx' not handled in switch
example:xxx.c:3452: warning: enumeration value 'E_SIMU_DEFAULT' not handled in switch
原因可能是switch中的枚举类型参数所对应的枚举值没有被完全处理。
可能解决方法:1.在switch中加上default:break; 2.将未处理的类型全部加break处理
(5)Formal argument parent of type extern "C" aaa in call to bbb(extern "C" aaa) is being passed aaa.
Warning (Anachronism): Formal argument parent of type extern "C" void(*)() in call to dxdpEventLoop(extern "C" void(*)()) is being passed void(*)().
原因是该类型要求是一个c-link的函数,但是传入了一个C++link的函数
可能解决方法: extern “C”
{
aaa;
}
(6) argument #n is incompatible with prototype:
example:
xxx.c", line 2276: warning: argument #1 is incompatible with prototype
原因是传入得参数,在系统中使用了隐式转换
可能解决方法是对该参数进行强制转换。
(7) deprecated conversion from string constant to 'char*'
example:
xxx.c:166: warning: deprecated conversion from string constant to 'char*'
原因可能是将const char*参数传递给char* 参数
解决方法可能是在该string前加(char*)做强制转换。
- 32位linux平台和saloris平台compile warning总结参考
- 64位平台转32位平台总结
- Linux 32和64位平台下支持LFS
- 【dotnet跨平台】VSCode Linux 32位和Linux 64位下载地址分享
- Linux平台编译curl7.37.1(32位、64位)
- PHP 内置 函数 32 位 和 64 位平台兼容性问题
- 32位和64位平台锁大小比较
- 32位平台和64位平台C代码的一个小差异
- 基于windriver开发驱动,64位平台和32位平台一次解决
- C/C++ 32位机器和64位机器 差异问题总结 跨平台 移植问题 语言编程需要注意的64位和32机器的区别
- VS2013 32位平台切换到64位平台
- 32位平台代码向64位平台移植
- linux平台调试技术总结。
- Linux平台卸载MySQL总结
- Linux平台卸载MySQL总结
- Linux平台卸载MySQL总结
- Linux平台卸载MySQL总结
- Linux平台卸载MySQL总结
- visual studio 2005 C++ 如何添加 Microsoft FlexGrid Control
- VB+asp.net上传文件
- Liferay 6.0.5的Bug--用IE浏览不能Add Application 的解决办法
- 64bit ubuntu下lashplayer简单安装
- google map加载多个Overlay内存溢出
- 32位linux平台和saloris平台compile warning总结参考
- 可执行文件的内容分析工具
- ffmpeg and Android.mk
- sprintf的使用
- 辛苦收集的Google map离线地图缓存,希望对大家有用
- http://www.linuxgraphics.cn/home/index.html
- sql update 触发器 获得被update的行的信息
- 用Python提取exe图标icon
- C# winform oracle连接数据库类 和app.config 简单配置