-Wshadow


#1

assuming those won't be fixed in juce itself, is there a way to silence those warnings in all of juce without silencing them in client code?

thx,

 


#2

I build lots of projects with -Wshadow and fixed any warnings a long time ago.  Which ones are you talking about?


#3
/home/plaufenb/development/git/JUCE/modules/juce_core/native/juce_linux_CommonFile.cpp:141:89: warning: declaration shadows a field of 'juce::DirectoryIterator' [-Wshadow]
DirectoryIterator::NativeIterator::NativeIterator (const File& directory, const String& wildCard)
                                                                                        ^
/home/plaufenb/development/git/JUCE/modules/juce_core/files/juce_DirectoryIterator.h:144:12: note: previous declaration is here
    String wildCard, path;
           ^
In file included from /home/plaufenb/development/git/JUCE/modules/juce_core/juce_core.cpp:207:
/home/plaufenb/development/git/JUCE/modules/juce_core/native/juce_linux_Network.cpp:185:37: warning: declaration shadows a field of 'juce::WebInputStream' [-Wshadow]
                          const int numRedirectsToFollow)
                                    ^
/home/plaufenb/development/git/JUCE/modules/juce_core/native/juce_linux_Network.cpp:172:15: note: previous declaration is here
    const int numRedirectsToFollow;
              ^
(...)

/home/plaufenb/development/git/JUCE/modules/juce_gui_basics/native/juce_linux_Windowing.cpp:590:27: warning: declaration shadows a field of 'juce::XBitmapImage' [-Wshadow]
                const int pixelStride = 2;
                          ^
/home/plaufenb/development/git/JUCE/modules/juce_gui_basics/native/juce_linux_Windowing.cpp:729:9: note: previous declaration is here
    int pixelStride, lineStride;
        ^
/home/plaufenb/development/git/JUCE/modules/juce_gui_basics/native/juce_linux_Windowing.cpp:591:27: warning: declaration shadows a field of 'juce::XBitmapImage' [-Wshadow]
                const int lineStride = ((w * pixelStride + 3) & ~3);
                          ^
/home/plaufenb/development/git/JUCE/modules/juce_gui_basics/native/juce_linux_Windowing.cpp:729:22: note: previous declaration is here
    int pixelStride, lineStride;
                     ^
/home/plaufenb/development/git/JUCE/modules/juce_gui_basics/native/juce_linux_Windowing.cpp:1146:34: warning: declaration shadows a field of 'juce::LinuxComponentPeer' [-Wshadow]
        unsigned int ww, wh, bw, depth;
                                 ^
/home/plaufenb/development/git/JUCE/modules/juce_gui_basics/native/juce_linux_Windowing.cpp:1977:9: note: previous declaration is here
    int depth;
        ^
/home/plaufenb/development/git/JUCE/modules/juce_gui_basics/native/juce_linux_Windowing.cpp:2387:46: warning: declaration shadows a field of 'juce::LinuxComponentPeer' [-Wshadow]
            unsigned int ww = 0, wh = 0, bw, depth;
                                             ^
/home/plaufenb/development/git/JUCE/modules/juce_gui_basics/native/juce_linux_Windowing.cpp:1977:9: note: previous declaration is here
    int depth;
        ^
/home/plaufenb/development/git/JUCE/modules/juce_gui_basics/native/juce_linux_Windowing.cpp:3012:45: warning: declaration shadows a field of 'juce::Desktop' [-Wshadow]
void Desktop::setKioskComponent (Component* kioskModeComponent, bool enableOrDisable, bool /* allowMenusAndBars */)
                                            ^
/home/plaufenb/development/git/JUCE/modules/juce_gui_basics/components/juce_Desktop.h:427:16: note: previous declaration is here
    Component* kioskModeComponent;
               ^
2 warnings generated.

(...)

 

a random / impromptu selection. This is clang / libc++ on Debian Wheezy... for another week until the Jessie release. Do you need more details?

thx,

-- p


#4

Ah, it's linux - I had only tried the flag on OSX so hadn't seen the places in linux-specific code where there were warnings. Thanks, we'll tidy those up..