Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[FIX] Build fails on GCC 13.2.1 with dex_instruction.c:655:43: error: argument 2 of type ‘u4[kMaxVarArgRegs]’ {aka ‘unsigned int[kMaxVarArgRegs]’} declared as a variable length array [-Werror=vla-parameter] #82

Open
dreirund opened this issue May 5, 2024 · 4 comments

Comments

@dreirund
Copy link

dreirund commented May 5, 2024

I am building with GCC version 13.2.1.

./make.sh fails with

[...]
gcc -c -std=c11 -D_GNU_SOURCE -Wall -Wextra -Werror -DVERSION=\"dev-78f283b\" -c dex_instruction.c -o dex_instruction.o
dex_instruction.c:655:43: error: argument 2 of type ‘u4[kMaxVarArgRegs]’ {aka ‘unsigned int[kMaxVarArgRegs]’} declared as a variable length array [-Werror=vla-parameter]
  655 | void dexInstr_getVarArgs(u2 *code_ptr, u4 arg[kMaxVarArgRegs]) {
      |                                        ~~~^~~~~~~~~~~~~~~~~~~
In file included from dex_instruction.c:23:
dex_instruction.h:278:32: note: previously declared as an ordinary array ‘u4[]’ {aka ‘unsigned int[]’}
  278 | void dexInstr_getVarArgs(u2 *, u4[]);
      |                                ^~~~
cc1: all warnings being treated as errors
make: *** [Makefile:56: dex_instruction.o] Error 1

A manual workaround is to issue make CFLAGS="${CFLAGS} -Wno-error=vla-parameter" -C src instead of ./make.sh.

Regards!

@dreirund dreirund changed the title build fails with dex_instruction.c:655:43: error: argument 2 of type ‘u4[kMaxVarArgRegs]’ {aka ‘unsigned int[kMaxVarArgRegs]’} declared as a variable length array [-Werror=vla-parameter] Build fails with dex_instruction.c:655:43: error: argument 2 of type ‘u4[kMaxVarArgRegs]’ {aka ‘unsigned int[kMaxVarArgRegs]’} declared as a variable length array [-Werror=vla-parameter] May 5, 2024
@dreirund dreirund changed the title Build fails with dex_instruction.c:655:43: error: argument 2 of type ‘u4[kMaxVarArgRegs]’ {aka ‘unsigned int[kMaxVarArgRegs]’} declared as a variable length array [-Werror=vla-parameter] Build fails on GCC 13.2.1 with dex_instruction.c:655:43: error: argument 2 of type ‘u4[kMaxVarArgRegs]’ {aka ‘unsigned int[kMaxVarArgRegs]’} declared as a variable length array [-Werror=vla-parameter] May 5, 2024
@RJMultiDev
Copy link

i found that you can edit src/Makefile and remove '-Werror' to build it

@dreirund
Copy link
Author

dreirund commented Jul 23, 2024

i found that you can edit src/Makefile and remove -Werror to build it

Ahoj,

now that a fix is known, how about implementing the fix, @anestisb?

@dreirund dreirund changed the title Build fails on GCC 13.2.1 with dex_instruction.c:655:43: error: argument 2 of type ‘u4[kMaxVarArgRegs]’ {aka ‘unsigned int[kMaxVarArgRegs]’} declared as a variable length array [-Werror=vla-parameter] [FIX] Build fails on GCC 13.2.1 with dex_instruction.c:655:43: error: argument 2 of type ‘u4[kMaxVarArgRegs]’ {aka ‘unsigned int[kMaxVarArgRegs]’} declared as a variable length array [-Werror=vla-parameter] Jul 23, 2024
@RJMultiDev
Copy link

i found that you can edit src/Makefile and remove -Werror to build it

Ahoj,

now that a fix is known, how about implementing the fix, @anestisb?

I have created a pull request.
You can try Fixed version and build it.
Maybe later i'll create a release.

@dreirund
Copy link
Author

dreirund commented Jul 23, 2024 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants