问题
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