compilin error: fields must have a constant size: 'variable length array in structure' extension will never be supported on android 2.3.4 source code

为君一笑 提交于 2019-12-13 05:07:52

问题


Hi I am having the following error when tried make libdvm in android 2.3.4 source code,

external/elfutils/libebl/eblobjnote.c:43:17: error: fields must have a constant size: 'variable length array in structure' extension will never be supported
              uint32_t version[descsz / 4 - 1];

this is a genuine c error reported by gcc 4.2 on my mac os x mountain lion. I guess there is some incompability with gcc 4.2 and android 2.3.4 source code. I had to change few things to make the compilation reach this point. I do not know which gcc version was used to compile the code but gcc 4.2 is frequently finding errors in the code.

Can anyone tell me how can I deal with these errors, or in the worst case which gcc version I should use and how can I downgrade to that specific version in mac os x?


回答1:


Well, I figured out the problem. Actually CC was linked to clang not gcc, and clang was more restrictive. I used gcc instead of clang and the problem resolved. Although some other compilation errors were there and I believe the project was compiled with gcc older than 4, as the errors I found were reported by gcc.



来源:https://stackoverflow.com/questions/19416608/compilin-error-fields-must-have-a-constant-size-variable-length-array-in-stru

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!