recv_image.c:129 : error: storage size of 'rq' isn't known
2011-06-09 14:43
423 查看
Bug Description
Binary package hint: mtd-utilsWe didn't find the mtd-utils package in Ubuntu intrepid.
We found this page (https://edge.launchpad.net/ubuntu/intrepid/+source/mtd-utils/20080508-1) that points a build fail.
In the following page we found the error: http://launchpadlibrarian.net/17423696/buildlog_ubuntu-intrepid-i386.mtd-utils_20080508-1_FAILEDTOBUILD.txt.gz
==============
recv_image.c: In function 'main':
recv_image.c:129: error: storage size of 'rq' isn't known
recv_image.c:129: warning: unused variable 'rq'
recv_image.c:311: warning: format '%08lx' expects type 'long unsigned int', but argument 2 has type 'uint32_t'
recv_image.c:311: warning: format '%08lx' expects type 'long unsigned int', but argument 3 has type 'uint32_t'
recv_image.c:311: warning: format '%08lx' expects type 'long unsigned int', but argument 4 has type 'uint32_t'
make[1]: *** [recv_image.o] Error 1
==============
We start to investigate and we found that the struct "struct ip_mreq" is defined in "#include <netinet/in.h>" only if "__USE_MISC or __USE_GNU" are defined.
But we cannot define one of them directly in recv_image.c as the header feature.h undefine them and it just redefine __USE_GNU if _GNU_SOURCE is defined. So we just need to define _GNU_SOURCE symbol.
We found the wrong define" #define _USE_MISC" (note the suffix _ instead of __) that is not being used for anything. So our patch switch the define from _USE_MISC to _GNU_SOURCE
There is a patch in upstream (http://git.infradead.org/mtd-utils.git?a=commitdiff;h=b995f89a81589be8d8a41c374a6df109d0ee12b3) to fix the same error BUT we think it's wrong to define "__USE_*" symbols, as <features.h> would undefine them. It is working just because the define is just before the <netinet/in.h> include.
Both patches have also a change in a printf line, just to remove some copiler warnings.
IS VERY important that mtd-utils package being included in universe repository again, we think many people use these tools. It includes, for instance, the binary mkfs.jffs2, very important to research in embedded systems.
Lauro Venancio <email address hidden> and Aloisio Almeida Jr <email address hidden> are the authors of this research and patch
相关文章推荐
- error: storage size of 'rq' isn't known 正解
- storage size of 'value' isn't known问题出现的可能原因
- error storage size of 'pwbuf' isn't known
- storage size of `seraddr' isn't known #include
- error: implicit declaration of function 'class_device_create' error: implicit declaration of functio
- Error:ImageIOpng.cpp:(.text+0x5b9): undefined reference to `png_create_write_struct'等
- ubuntu12.04连接服务器的时候出现错误“terminate called after throwing an instance of 'std::runtime_error' what(”
- Cocos2d-x 3.0 编译出错 解决 error: expected ';' at end of member declaration
- 继承QTreeWidgetItem发生error: 'staticMetaObject' is not a member of 'QTreeWidgetItem' 错误
- (Android jni) error: base operand of '->' has non-pointer type '_JNIEnv'
- 关于error:Cannot assign to 'self' outside of a method in the init family
- Error: Unsupported java version '1.8' in line 2 of file 'proguard.conf'
- WinPcap编程错误:error C2079: 'IPAddress' uses undefined struct 'sockaddr_storage的解决办法
- error: invalid use of incomplete type 'XXXX' ;error: forward declaration of 'XXXX' 声明改为包含头文件
- PIL IOError: cannot identify image file 'images/1212.jpg'的解决办法
- error: L6047U: The size of this image (32868 bytes) exceeds the maximum allowed for this version of
- ERROR ITMS-90032: "Invalid Image Path - No image found at the path referenced under key 'CFBundkeIco
- python 验证码识别:pytesser .image_file_to_string('1.tif') WindowsError: [Error 2] 解决办法
- error: two or more data types in declaration of 'main'
- C/C++ error: storage size of ‘tv’ isn’t known错误解决方法