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

bootutil: replace C specific static assert #1797

Closed

Conversation

tito97sp
Copy link
Contributor

@tito97sp tito97sp commented Sep 4, 2023

Defect detected

_Static_assert defined in C11.

Error log

Compilation raises the following compilation error in this line:

https://github.com/mcu-tools/mcuboot/blob/main/boot/bootutil/include/bootutil/image.h#L163-L164

mcuboot/boot/bootutil/include/bootutil/image.h:163:15: error: expected constructor, destructor, or type conversion before '(' token
  163 | _Static_assert(sizeof(struct image_header) == IMAGE_HEADER_SIZE,
      |               ^
compilation terminated due to -Wfatal-errors.

Proposed Fix

Following modification fixes the issue.

static_assert((sizeof(struct image_header)) == IMAGE_HEADER_SIZE, 
                "struct image_header not required size\n");

Change Log

Change added in this commit e3cbbec

Comments

Please @d3zd3z can you check this?

Signed-off-by: Andrés Sánchez Pascual <[email protected]>
@d3zd3z d3zd3z self-requested a review December 14, 2023 15:25
Copy link

This pull request has been marked as stale because it has been open (more than) 60 days with no activity. Remove the stale label or add a comment saying that you would like to have the label removed otherwise this pull request will automatically be closed in 14 days. Note, that you can always re-open a closed pull request at any time.

@github-actions github-actions bot added the stale label Jun 12, 2024
@github-actions github-actions bot closed this Jun 27, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant