使用GCC4.8 编译android内核提示warning: argument to ‘sizeof’ in ‘void* memset(void*, int, size_t)’
2013-10-14 22:45
1271 查看
完整的warning为:
解决方法,参考:
http://gcc.gnu.org/gcc-4.8/porting_to.html
方法1:
方法2:
在Makefile添加:
KBUILD_CFLAGS += -Wno-sizeof-pointer-memaccess
warning: argument to ‘sizeof’ in ‘void* memset(void*, int, size_t)’ call is the same expression as the destination; did you mean to dereference it? [-Wsizeof-pointer-memaccess]
解决方法,参考:
http://gcc.gnu.org/gcc-4.8/porting_to.html
方法1:
#include <string.h> struct A { }; int main(void) { A obj; A* p1 = &obj; A p2[10]; memset(p1, 0, sizeof(p1)); // error memset(p1, 0, sizeof(*p1)); // ok, dereferenced memset(p2, 0, sizeof(p2)); // ok, array return 0; }
方法2:
在Makefile添加:
KBUILD_CFLAGS += -Wno-sizeof-pointer-memaccess
相关文章推荐
- Android apk反编译学习【天天酷跑】
- 【移动开发】Android中三种超实用的滑屏方式汇总(ViewPager、ViewFlipper、ViewFlow)
- Android开发探秘之四:利用Intent实现数据传递
- android sdk Error: Missing platform-tools
- [Android] JNI 中传递字符串参数(String)的安全处理方式
- 一名普通Android开发者入住51cto
- android 记录手机操作行为并将其转换成gif图片
- Android学习记录:jni 的那些事(不断整理更新)
- Android基础——Activity生命周期
- Android中全屏(取消标题栏,设置NoTitleBar)的三种方法
- android AsyncTask介绍
- Android开机画面的修改
- About android studio
- 利用BLCR加速android的启动(android4.2)
- android下的消息机制:handler
- android下内容观察者: ContentObserver
- android下UriMatcher类使用介绍
- android下uri介绍
- android下的数据库事物: Transaction
- android基础零碎小记录