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

flag_enabled(): declare is local by default - remove it #4054

Merged
merged 1 commit into from
Dec 13, 2019
Merged

flag_enabled(): declare is local by default - remove it #4054

merged 1 commit into from
Dec 13, 2019

Conversation

MilhouseVH
Copy link
Contributor

Reviewing the flag_enabled() code that sets the flag variable (ie. PKG_SPEED_TARGET_ENABLED etc.) I noticed the declared variables were not actually visible outside of the flag_enabled() function.

From help declare:

    When used in a function, `declare' makes NAMEs local, as with the `local'
    command.  The `-g' option suppresses this behavior.

Adding the -g option would allow the variables to become visible to the caller, meaning this code would work as intended.

However, as the variables are not currently used and I suspect will almost certainly never be used, I'd like to remove support for the declared variables as it complicates the function unnecessarily, could potentially result in a hard-to-debug variable name collision, and is just additional overhead.

Copy link
Member

@InuSasha InuSasha left a comment

Choose a reason for hiding this comment

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

not build tested, but sounds reasonable.

@InuSasha InuSasha merged commit ebaff13 into LibreELEC:master Dec 13, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants