-
Notifications
You must be signed in to change notification settings - Fork 245
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
[BFW-6709] WI_SWITCH_t : Ensure that variable "index" is private, preventing use outside the derived class #4177
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
See #4176 for first commit issues. The correct solution would be to do:
SetIndex(netdev_get_ip_obtained_type(this->device_id()));
instead of
index = netdev_get_ip_obtained_type(this->device_id());
Also, this will need to be changed on more places to make other build targets to build.
50eca04
to
a36bba8
Compare
Updated, looks like it does build fine now :) |
a36bba8
to
1c354ea
Compare
…utside the derived class
1c354ea
to
696b4c2
Compare
Internal ticket: BFW-6709 |
…and fix reorder compilation warning
20aabd2
to
997c62b
Compare
I have removed the |
Reuse of the variable "index" within a WI_SWITCH_t derived class can lead to issues as the variable "index" might be used outside the WI_SWITCH_t class and could interfer with the derived class index value, thus leading to functionality issues. By redefining index as private variable in WI_SWITCH_t and making usage of the defined GetIndex/SetIndex functions, similar issues can be prevented in the future.