Skip to content

Conversation

@tony-josi-aws
Copy link
Member

Description

This PR updates the codebase to remove declarations after statements that are non compliant as per the C90 standard.

Test Steps

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

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

@tony-josi-aws tony-josi-aws requested a review from a team as a code owner February 23, 2024 07:17
@tony-josi-aws
Copy link
Member Author

/bot run formatting

@tony-josi-aws tony-josi-aws force-pushed the fix_declarations_after_statement branch from e19842b to cce51c6 Compare February 23, 2024 07:19
Copy link
Contributor

@shubnil shubnil left a comment

Choose a reason for hiding this comment

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

The change looks good.
But, I have 2 queries.

  1. Is declaration at the top enough for C90 or should we initialize to some default values as well
  2. Are we just moving the declaration up and initialization is still at its place

@tony-josi-aws
Copy link
Member Author

  1. Declaration itself is enough
  2. If we are able to know the data before hand like constants we are initializing it during declaration itself, but for the cases were it depends on other variables/function calls we defer the initialization until other variables are known

@tony-josi-aws tony-josi-aws merged commit ef14a08 into FreeRTOS:main Feb 23, 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