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

2 tests fail with GCC 9.3: “array subscript -1 is outside array bounds of ‘uint32_t[1]’” #89

Closed
hikari-no-yume opened this issue Feb 26, 2021 · 1 comment

Comments

@hikari-no-yume
Copy link
Collaborator

hikari-no-yume commented Feb 26, 2021

  • test_consistent_return_value_c[test_char_sized_ptr_math_decr--O2]
  • test_consistent_return_value_c[test_char_sized_ptr_math_decr--O3]

I think the error message is self-explanatory, and it seems completely correct, the generated C is indeed using -1 as an array index, and that looks like the intent of the source file test/c_tests/pointers/test_char_sized_ptr_math_decr.c too.

I don't know what to reasonably do about this. Silence the warning with another GCC flag?

Not a big deal in any case.

@hikari-no-yume
Copy link
Collaborator Author

hikari-no-yume commented Feb 26, 2021

Adding -Warray-bounds=0 to the flags passed to GCC is enough to make it shut up.

It would probably be best to localise this to just tests based on test_char_sized_ptr_math_decr.c.

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

1 participant