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

Firefly driver: Postpone variable definitions until first use #995

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from

Conversation

forderud
Copy link
Contributor

@forderud forderud commented Jun 14, 2023

Motivation:

  • Improves readability and maintainability.
  • Have been supported since C99.
  • Can potentially reduce stack size usage when variable usage is confined to a local scope. Example: usage and usageLength variables in hid/firefly/driver/vfeature.c. The compiler is probably already optimizing this though.

Downside:

  • It's a bit more cumbersome to manually determine the stack size of a function when all local variables are no longer listed together. However, tools can still do this effectively.

@forderud forderud requested a review from a team as a code owner January 31, 2024 11:43
@forderud forderud changed the base branch from main to develop January 31, 2024 11:43
@forderud forderud requested a review from a team as a code owner May 3, 2024 10:34
@JakobL-MSFT JakobL-MSFT deleted the branch microsoft:develop May 22, 2024 16:08
@JakobL-MSFT
Copy link
Contributor

I closed this PR unintentionally. I apologize. I am reopening the PR.

Motivation:
* Improves readability and maintainability.
* Have been supported since C99.
* Can potentially reduce stack size usage when variables are confined to a local scope.

Downside:
* It's a bit more cumbersome to manually determine the stack size of a function when all local variables are no longer listed together. However, tools can still do this effectively.
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.

None yet

2 participants