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

Fix VTOL enum shadowing #12108

Merged
merged 1 commit into from
May 30, 2019
Merged

Fix VTOL enum shadowing #12108

merged 1 commit into from
May 30, 2019

Conversation

julianoes
Copy link
Contributor

This changes the enums used for various VTOL states to enum classes which makes them type-safe and should avoid shadowing.

This change was motivated by a Clang warning about shadowing of the enum const TRANSITION_TO_FW which was declared twice, once in vtol_type.h and once in standard.h.

In file included from /home/julianoes/src/Firmware/src/modules/vtol_att_control/vtol_att_control_main.cpp:49:
In file included from /home/julianoes/src/Firmware/src/modules/vtol_att_control/vtol_att_control_main.h:83:
/home/julianoes/src/Firmware/src/modules/vtol_att_control/standard.h:91:3: fatal error: declaration shadows a variable in the global namespace [-Wshadow]
                TRANSITION_TO_FW,
                ^
/home/julianoes/src/Firmware/src/modules/vtol_att_control/vtol_type.h:78:2: note: previous declaration is here
        TRANSITION_TO_FW = 1,
        ^
1 error generated.

This change only removes the shadowing but presumably these enums could be cleaned up and consolidated further.

FYI @sfuhrer

This changes the enums used for various VTOL states to enum classes
which makes them type-safe and should avoid shadowing.

This change was motivated by a Clang warning about shadowing of the
enum const TRANSITION_TO_FW which was declared twice, once in
vtol_type.h and once in standard.h.

This change only removes the shadowing but presumably these enums could
be cleaned up and consolidated further.
@julianoes julianoes requested review from dagar and RomanBapst May 29, 2019 14:12
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.

2 participants