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

Define default values of macros before first use #298

Merged
merged 1 commit into from
Apr 2, 2021

Conversation

aggarg
Copy link
Member

@aggarg aggarg commented Mar 31, 2021

Description

configSTACK_ALLOCATION_FROM_SEPARATE_HEAP was added recently in #267. This macro was used in portable.h before its default value was defined in FreeRTOS.h, resulting in a warning when built with -Wundef. This change moves the default value definition for configSTACK_ALLOCATION_FROM_SEPARATE_HEAP to portable.h to ensure that it is defined before first use.

portUSING_MPU_WRAPPERS check in mpu_wrappers.h was updated in #285. The new check results in a warning when built with -Wundef because portUSING_MPU_WRAPPERS is not defined yet. This change adds the default value definition for portUSING_MPU_WRAPPERS to portable.h to ensure that it is defined before first use.

Test Steps

Built the code with the following flags: -Wunused -Wuninitialized -Wall -Wextra -Wmissing-declarations -Wpointer-arith -Wbad-function-cast -Wshadow -Wstrict-prototypes -Wmissing-prototypes -Wundef

Related Issue

https://forums.freertos.org/t/freertos-kernel-repos-pr-267-is-insufficient-for-high-warning-level-compile-option/12155

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

configSTACK_ALLOCATION_FROM_SEPARATE_HEAP was added recently in
FreeRTOS#267. This macro was
used in portable.h before its default value was defined, resulting in a
warning when built with -Wundef. This changes moves the default value
definition for configSTACK_ALLOCATION_FROM_SEPARATE_HEAP to portable.h
to ensure that it is defined before first use.

portUSING_MPU_WRAPPERS check in mpu_wrappers.h was updated in
FreeRTOS#285. The new check
results in a warning when built with -Wundef because
portUSING_MPU_WRAPPERS is not defined yet. This changes adds the default
value definition for portUSING_MPU_WRAPPERS to portable.h to ensure that
it is defined before first use.

Signed-off-by: Gaurav Aggarwal <aggarg@amazon.com>
@aggarg aggarg requested a review from a team as a code owner March 31, 2021 21:17
@codecov
Copy link

codecov bot commented Apr 1, 2021

Codecov Report

Merging #298 (ffe8271) into main (534eba6) will decrease coverage by 20.65%.
The diff coverage is n/a.

Impacted file tree graph

@@             Coverage Diff              @@
##              main     #298       +/-   ##
============================================
- Coverage   100.00%   79.34%   -20.66%     
============================================
  Files            1        1               
  Lines           37      184      +147     
  Branches         3       45       +42     
============================================
+ Hits            37      146      +109     
- Misses           0       14       +14     
- Partials         0       24       +24     
Flag Coverage Δ
unittests 79.34% <ø> (-20.66%) ⬇️

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

Impacted Files Coverage Δ
list.c
event_groups.c 79.34% <0.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 534eba6...ffe8271. Read the comment docs.

@paulbartell
Copy link
Contributor

Note regarding the codecov report: A new unit test was added which caused the decrease in line coverage. This was not due to the changes in this PR.

@n9wxu n9wxu merged commit b08c19f into FreeRTOS:main Apr 2, 2021
@aggarg aggarg deleted the default_macro_definitions branch April 2, 2021 18:44
laroche pushed a commit to laroche/FreeRTOS-Kernel that referenced this pull request Apr 18, 2024
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.

5 participants