Fix IAR alignment issues if __packed has been redefined into a macro. #152
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
While porting Zephyr to work with IAR tools, a problem was discovered
due to Zephyr defining a macro,
__packed
, the overrides the IAR keyword__packed
.The macro is defined to
attribute(packed)
in Zephyr.As Zephyr uses mbedtls as an external module, the macro
__packed
thatZephyr sets up does not work with the typedefs of unaligned int
types in core/alignment.h.
We therefor save the macro (if set), undefine it, declare the unaligned int types,
and restore the macro afterwards.
When accepted, a backport to the version Zephyr uses will be made.
PR checklist
Please remove the segment/s on either side of the | symbol as appropriate, and add any relevant link/s to the end of the line.
If the provided content is part of the present PR remove the # symbol.