Skip to content

tasks.c:2067:11: warning: this condition has identical branches [-Wduplicated-branches] #482

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

Conversation

pierrenoel-bouteville-act
Copy link
Contributor

Description

Replace duplicated if branch because empty by a comment to avoid warning/error with option GCC -Wduplicated-branches

Test Steps

Build file with -Wduplicated-branches and -Werror with GCC

Related Issue

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

Pierre-Noel Bouteville added 3 commits April 5, 2022 15:33
tasks.c Outdated
Comment on lines 2068 to 2072
/* if just above call of xPortStartScheduler not return pdFALSE
* Should not reach here as if the scheduler is running the
* function will not return.
* otherwise
* Should only reach here if a task calls xTaskEndScheduler(). */
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
/* if just above call of xPortStartScheduler not return pdFALSE
* Should not reach here as if the scheduler is running the
* function will not return.
* otherwise
* Should only reach here if a task calls xTaskEndScheduler(). */
/* In most cases, xPortStartScheduler() will not return. If it
* returns pdTRUE then there was not enough heap memory available
* to create either the Idle or the Timer task. If it returned
* pdFALSE, then the application called xTaskEndScheduler().
* Most ports don't implement xTaskEndScheduler() as there is
* nothing to return to. */

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

@codecov
Copy link

codecov bot commented Apr 6, 2022

Codecov Report

Merging #482 (f0fe0c3) into main (b5b1ff0) will not change coverage.
The diff coverage is n/a.

@@           Coverage Diff           @@
##             main     #482   +/-   ##
=======================================
  Coverage   92.44%   92.44%           
=======================================
  Files           4        4           
  Lines        1270     1270           
  Branches      343      343           
=======================================
  Hits         1174     1174           
  Misses         50       50           
  Partials       46       46           
Flag Coverage Δ
unittests 92.44% <ø> (ø)

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


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 b5b1ff0...f0fe0c3. Read the comment docs.

…-branches

* remotes/upstream/main:
  Add a guard around mpu_wrappers.c (FreeRTOS#480)
@pierrenoel-bouteville-act
Copy link
Contributor Author

Sorry But it don't understand why formatting failed ?

@aggarg aggarg closed this Apr 6, 2022
@aggarg
Copy link
Member

aggarg commented Apr 6, 2022

Please apply the following patch - formatting.zip

@aggarg aggarg reopened this Apr 6, 2022
@aggarg aggarg merged commit cf4ff12 into FreeRTOS:main Apr 6, 2022
@pierrenoel-bouteville-act pierrenoel-bouteville-act deleted the Wduplicated-branches branch April 7, 2022 08:06
pierrenoel-bouteville-act pushed a commit to All-Circuits-Technologies/FreeRTOS-Kernel that referenced this pull request Apr 7, 2022
* remotes/upstream/main:
  tasks.c:2067:11: warning: this condition has identical branches [-Wduplicated-branches] (FreeRTOS#482)
  Add a guard around mpu_wrappers.c (FreeRTOS#480)
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.

3 participants