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

-Wshadow warnings in nfd_gtk.cpp #149

Closed
azonenberg opened this issue Sep 15, 2024 · 1 comment · Fixed by #150
Closed

-Wshadow warnings in nfd_gtk.cpp #149

azonenberg opened this issue Sep 15, 2024 · 1 comment · Fixed by #150

Comments

@azonenberg
Copy link

azonenberg commented Sep 15, 2024

The following warnings are seen when compiling with -Wshadow enabled (and break the build when -Werror is active).

/ceph/fast/home/azonenberg/code/scopehal-apps/src/nativefiledialog-extended/src/nfd_gtk.cpp: In constructor ?{anonymous}::NativeWindowParenter::NativeWindowParenter(GtkWidget*, const nfdwindowhandle_t&)?:
/ceph/fast/home/azonenberg/code/scopehal-apps/src/nativefiledialog-extended/src/nfd_gtk.cpp:450:37: error: declaration of ?widget? shadows a member of ?{anonymous}::NativeWindowParenter? [-Werror=shadow]
  450 |     NativeWindowParenter(GtkWidget* widget, const nfdwindowhandle_t& parentWindow) noexcept
      |                          ~~~~~~~~~~~^~~~~~
/ceph/fast/home/azonenberg/code/scopehal-apps/src/nativefiledialog-extended/src/nfd_gtk.cpp:472:22: note: shadowed declaration is here
  472 |     GtkWidget* const widget;
      |                      ^~~~~~
/ceph/fast/home/azonenberg/code/scopehal-apps/src/nativefiledialog-extended/src/nfd_gtk.cpp: In constructor ?{anonymous}::NativeWindowParenter::NativeWindowParenter(GtkWidget*, const nfdwindowhandle_t&)?:
/ceph/fast/home/azonenberg/code/scopehal-apps/src/nativefiledialog-extended/src/nfd_gtk.cpp:450:37: error: declaration of ?widget? shadows a member of ?{anonymous}::NativeWindowParenter? [-Werror=shadow]
  450 |     NativeWindowParenter(GtkWidget* widget, const nfdwindowhandle_t& parentWindow) noexcept
      |                          ~~~~~~~~~~~^~~~~~
/ceph/fast/home/azonenberg/code/scopehal-apps/src/nativefiledialog-extended/src/nfd_gtk.cpp:472:22: note: shadowed declaration is here
  472 |     GtkWidget* const widget;
      |                      ^~~~~~
/ceph/fast/home/azonenberg/code/scopehal-apps/src/nativefiledialog-extended/src/nfd_gtk.cpp: In constructor ?{anonymous}::NativeWindowParenter::NativeWindowParenter(GtkWidget*, const nfdwindowhandle_t&)?:
/ceph/fast/home/azonenberg/code/scopehal-apps/src/nativefiledialog-extended/src/nfd_gtk.cpp:450:37: error: declaration of ?widget? shadows a member of ?{anonymous}::NativeWindowParenter? [-Werror=shadow]
  450 |     NativeWindowParenter(GtkWidget* widget, const nfdwindowhandle_t& parentWindow) noexcept
      |                          ~~~~~~~~~~~^~~~~~
/ceph/fast/home/azonenberg/code/scopehal-apps/src/nativefiledialog-extended/src/nfd_gtk.cpp:472:22: note: shadowed declaration is here
  472 |     GtkWidget* const widget;

@btzy
Copy link
Owner

btzy commented Sep 19, 2024

Thanks for the bug report. Yes, this seems to be a problem.

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 a pull request may close this issue.

2 participants