-
-
Notifications
You must be signed in to change notification settings - Fork 42.4k
core: chibios: bootloader: use integer pointers as volatile #13450
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
Conversation
This prevents gcc from incorrectly trying to validate array bounds.
```
tmk_core/common/chibios/bootloader.c: error: '__builtin_memcpy' offset [0, 21] is out of the bounds [0, 0] [-Werror=array-bounds]
107 | __builtin_memcpy((void *) VBAT, (const void *)sys_reset_to_loader_magic, sizeof(sys_reset_to_loader_magic));
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
```
See https://gcc.gnu.org/bugzilla/show_bug.cgi?id=99578#c16
Fixes qmk#12925
|
Just thought you may want to check this works, as OP doesn't have a Kinetis device :) |
|
Ah, read up a bit on #12925. Without that context I was wildly confused... I haven't had any such issues compiling on my Debian system, though. Maybe we should ping @TheEdgeOfRage to check if it solves their issue? :) |
|
Whoops, didn't notice the linked issue. Sorry for the noise. |
|
No problem, happy to help anyway. 😛 |
|
I can confirm that the fix doesn't seem to introduce any issues on my Debian system at least. Compiling (still) works fine, and my |
|
For completeness sake, I can confirm that this fixed it for me. Thanks 👍 |
This prevents gcc from incorrectly trying to validate array bounds.
```
tmk_core/common/chibios/bootloader.c: error: '__builtin_memcpy' offset [0, 21] is out of the bounds [0, 0] [-Werror=array-bounds]
107 | __builtin_memcpy((void *) VBAT, (const void *)sys_reset_to_loader_magic, sizeof(sys_reset_to_loader_magic));
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
```
See https://gcc.gnu.org/bugzilla/show_bug.cgi?id=99578#c16
Fixes qmk#12925
This prevents gcc from incorrectly trying to validate array bounds.
```
tmk_core/common/chibios/bootloader.c: error: '__builtin_memcpy' offset [0, 21] is out of the bounds [0, 0] [-Werror=array-bounds]
107 | __builtin_memcpy((void *) VBAT, (const void *)sys_reset_to_loader_magic, sizeof(sys_reset_to_loader_magic));
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
```
See https://gcc.gnu.org/bugzilla/show_bug.cgi?id=99578#c16
Fixes qmk#12925
Description
core: chibios: bootloader: use integer pointers as volatile
This prevents gcc from incorrectly trying to validate array bounds.
See https://gcc.gnu.org/bugzilla/show_bug.cgi?id=99578#c16
Types of Changes
Issues Fixed or Closed by This PR
Checklist
Note: This is only compile tested, as I don't have such a device.