Skip to content

Fix cast alignment warning in heap_4.c and heap_5.c #771

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

Merged
merged 5 commits into from
Sep 4, 2023

Conversation

kar-rahul-aws
Copy link
Member

Description

Without this change, the code produces the following warning when compiled with -Wcast-align flag:

cast increases required alignment of target type

Test Steps

  1. Build the code and see that it does not produce any warning.
  2. Run soak tests on GCC ARM CM3 and CM4 platforms.

Checklist:

  • I have tested my changes. No regression in existing tests.
  • I have modified and/or added unit-tests to cover the code changes in this Pull Request.

Related Issue

https://forums.freertos.org/t/freertos-heap-4-c-cast-error/18105

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

@kar-rahul-aws kar-rahul-aws requested a review from a team as a code owner August 31, 2023 19:55
@codecov
Copy link

codecov bot commented Aug 31, 2023

Codecov Report

Patch and project coverage have no change.

Comparison is base (1aaa318) 94.35% compared to head (fb80bd9) 94.35%.

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #771   +/-   ##
=======================================
  Coverage   94.35%   94.35%           
=======================================
  Files           6        6           
  Lines        2446     2446           
  Branches      598      598           
=======================================
  Hits         2308     2308           
  Misses         85       85           
  Partials       53       53           
Flag Coverage Δ
unittests 94.35% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

ActoryOu
ActoryOu previously approved these changes Sep 1, 2023
tony-josi-aws
tony-josi-aws previously approved these changes Sep 1, 2023
@kar-rahul-aws kar-rahul-aws marked this pull request as draft September 4, 2023 07:24
@kar-rahul-aws kar-rahul-aws dismissed stale reviews from tony-josi-aws and ActoryOu via edbeb62 September 4, 2023 07:52
@kar-rahul-aws kar-rahul-aws marked this pull request as ready for review September 4, 2023 09:16
@aggarg aggarg changed the title Fix cast alignment warning in heap_4.c Fix cast alignment warning in heap_4.c and heap_5.c Sep 4, 2023
@kar-rahul-aws kar-rahul-aws merged commit 231278e into FreeRTOS:main Sep 4, 2023
@kar-rahul-aws kar-rahul-aws deleted the fix_cast_align_warnings branch September 4, 2023 17:22
@Skptak Skptak mentioned this pull request Sep 4, 2023
2 tasks
@pete-pjb
Copy link

pete-pjb commented Sep 5, 2023

Hi @kar-rahul-aws ,

I have had to revert this PR on my platform (Zynq 7000 ARM CA9 ) it causes my system to fail the very first call to malloc asserting no memory when the scheduler is started.

I don't have much time today to look into it but I may be able to look into it later in the week if you are unable to address it in the meantime...

cc @aggarg
cc @tony-josi-aws
cc @Skptak

Kind Regards,

Pete

@aggarg
Copy link
Member

aggarg commented Sep 5, 2023

Hey @pete-pjb, Thank you for letting us know. Looking into it!

@aggarg
Copy link
Member

aggarg commented Sep 5, 2023

This PR should fix the issue - #781. Thanks again!

@pete-pjb
Copy link

pete-pjb commented Sep 6, 2023

This PR should fix the issue - #781. Thanks again!

It does indeed fix the issue, thank you @aggarg 🙂

cc @tony-josi-aws
cc @Skptak

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

Successfully merging this pull request may close these issues.

7 participants