-
Notifications
You must be signed in to change notification settings - Fork 4.8k
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
Variable shadowing #2763
Comments
Hi @SamuelLordBlack |
Yes, this warning is generated if a variable already exists in that scope, so the new variable masks the previous one. |
Got it |
dorodnic
added a commit
to dorodnic/librealsense
that referenced
this issue
Nov 28, 2018
Merged
dorodnic
added a commit
to dorodnic/librealsense
that referenced
this issue
Nov 28, 2018
@SamuelLordBlack - Should be resolved in 2.17.0 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
A minor request, but it would be nice if the RealSense header files would compile without warnings. We enable -Wshadow in our projects, and librealsense has several instances of variable shadowing in its header files. Our workaround has been to add #pragma GCC system_header to rs.hpp, but this is an additional step we have to remember each time we pull in a new drop, and it can mask actual issues.
For reference, 2.16.5 has the following instances of variable shadowing:
rs_frame.hpp:307:37: declaration of ‘frame_ref’ shadows a member of ‘rs2::frame’
rs_frame.hpp:659:28: declaration of ‘e’ shadows a previous local
rs_frame.hpp:856:28: declaration of ‘e’ shadows a previous local
rs_frame.hpp:871:48: declaration of ‘frame’ shadows a member of ‘rs2::frameset’
rs_frame.hpp:887:18: declaration of ‘frame’ shadows a member of ‘rs2::frameset’
rs_frame.hpp:931:55: declaration of ‘frame’ shadows a member of ‘rs2::frameset’
rs_sensor.hpp:17:9: declaration of ‘notification’ shadows a member of ‘rs2::notification’
rs_record_playback.hpp:214:9: declaration of ‘device’ shadows a member of ‘rs2::recorder’
rs_pipeline.hpp:323:52: declaration of ‘config’ shadows a member of ‘rs2::config’
The text was updated successfully, but these errors were encountered: