JSON incorrect object alignment in arrays with 64bit members #59585
Labels
area: JSON
bug
The issue is a bug, or the PR is fixing a bug
priority: low
Low impact/importance bug
Stale
Describe the bug
Adding a 64bit member to a struct used for encoding/decoding in an array results in incorrect alignments, while looping the elements.
EDIT: Adding elements that are not in the object description are not supported, however adding a member to the description with a
sizeof
8 still would not work.See #59485 for changes
Tested on x86 64bit. I think the issue comes from the use of
__alignof__
ininclude/zephyr/data/json.h
, as the alignment will be fixed to 8 bytes. But the compiler still appears to use a 4 byte alignment.To Reproduce
Steps to reproduce the behavior:
$ west build -p -b native_posix_64 -s tests/lib/json/
$ ./build/zephyr/zephyr.exe
Expected behavior
Adding such a member should not impact json encoding/decoding.
Impact
This currently blocks PR #59485.
Logs and console output
Environment (please complete the following information):
The text was updated successfully, but these errors were encountered: