Some compiler warnings


#1

Building latest juce with gcc-4.8 results in a few warnings.

juce_audio_processors.cpp:

In file included from ../source/modules/juce_audio_processors/juce_audio_processors.cpp:149:0:
../source/modules/juce_audio_processors/format_types/juce_LADSPAPluginFormat.cpp: In constructor ‘juce::LADSPAPluginInstance::LADSPAPluginInstance(const Ptr&)’:
../source/modules/juce_audio_processors/format_types/juce_LADSPAPluginFormat.cpp:487:23: warning: ‘juce::LADSPAPluginInstance::tempBuffer’ will be initialized after [-Wreorder]
     AudioSampleBuffer tempBuffer;
                       ^
../source/modules/juce_audio_processors/format_types/juce_LADSPAPluginFormat.cpp:479:29: warning:   ‘juce::LADSPAModuleHandle::Ptr juce::LADSPAPluginInstance::module’ [-Wreorder]
     LADSPAModuleHandle::Ptr module;
                             ^
../source/modules/juce_audio_processors/format_types/juce_LADSPAPluginFormat.cpp:120:5: warning:   when initialized here [-Wreorder]
     LADSPAPluginInstance (const LADSPAModuleHandle::Ptr& m)
     ^

juce_graphics.cpp:

In file included from ../source/modules/juce_graphics/juce_graphics.h:104:0,
                 from ../source/modules/juce_graphics/juce_graphics.cpp:39:
../source/modules/juce_graphics/native/juce_RenderingHelpers.h: In member function ‘void juce::RenderingHelpers::ClipRegions<SavedStateType>::RectangleListRegion::fillAllWithColour(SavedStateType&, juce::PixelARGB, bool) const [with SavedStateType = juce::RenderingHelpers::SoftwareRendererSavedState]’:
../source/modules/juce_graphics/native/juce_RenderingHelpers.h:659:17: warning: ‘*((void*)& r +32)’ may be used uninitialized in this function [-Wmaybe-uninitialized]
                 if (areRGBComponentsEqual)  // if all the component values are the same, we can cheat..
                 ^
In file included from ../source/modules/juce_graphics/juce_graphics.h:104:0,
                 from ../source/modules/juce_graphics/juce_graphics.cpp:39:
../source/modules/juce_graphics/native/juce_RenderingHelpers.h:1514:65: note: ‘*((void*)& r +32)’ was declared here
             EdgeTableFillers::SolidColour<DestPixelType, false> r (destData, fillColour);
                                                                 ^
In file included from ../source/modules/juce_graphics/juce_graphics.h:104:0,
                 from ../source/modules/juce_graphics/juce_graphics.cpp:39:
../source/modules/juce_graphics/native/juce_RenderingHelpers.h:659:17: warning: ‘*((void*)& r +32)’ may be used uninitialized in this function [-Wmaybe-uninitialized]
                 if (areRGBComponentsEqual)  // if all the component values are the same, we can cheat..
                 ^
In file included from ../source/modules/juce_graphics/juce_graphics.h:104:0,
                 from ../source/modules/juce_graphics/juce_graphics.cpp:39:
../source/modules/juce_graphics/native/juce_RenderingHelpers.h:1509:64: note: ‘*((void*)& r +32)’ was declared here
             EdgeTableFillers::SolidColour<DestPixelType, true> r (destData, fillColour);
                                                                ^
juce_gui_basics.cpp
In file included from ../source/modules/juce_gui_basics/../juce_graphics/../juce_core/juce_core.h:167:0,
                 from ../source/modules/juce_gui_basics/../juce_graphics/juce_graphics.h:28,
                 from ../source/modules/juce_gui_basics/juce_gui_basics.h:28,
                 from ../source/modules/juce_gui_basics/juce_gui_basics.cpp:41:
../source/modules/juce_gui_basics/../juce_graphics/../juce_core/maths/juce_MathsFunctions.h: In member function ‘int juce::TextEditor::findWordBreakAfter(int) const’:
../source/modules/juce_gui_basics/../juce_graphics/../juce_core/maths/juce_MathsFunctions.h:100:116: warning: assuming signed overflow does not occur when assuming that (X + c) >= X is always true [-Wstrict-overflow]
 inline Type jmax (const Type a, const Type b)                                               { return (a < b) ? b : a; }
                                                                                                                    ^
../source/modules/juce_gui_basics/../juce_graphics/../juce_core/maths/juce_MathsFunctions.h: In member function ‘int juce::TextEditor::findWordBreakBefore(int) const’:
../source/modules/juce_gui_basics/../juce_graphics/../juce_core/maths/juce_MathsFunctions.h:100:116: warning: assuming signed overflow does not occur when assuming that (X - c) <= X is always true [-Wstrict-overflow]
 inline Type jmax (const Type a, const Type b)                                               { return (a < b) ? b : a; }
                                                                                                                    ^
In file included from ../source/modules/juce_gui_basics/../juce_graphics/../juce_core/juce_core.h:200:0,
                 from ../source/modules/juce_gui_basics/../juce_graphics/juce_graphics.h:28,
                 from ../source/modules/juce_gui_basics/juce_gui_basics.h:28,
                 from ../source/modules/juce_gui_basics/juce_gui_basics.cpp:41:
../source/modules/juce_gui_basics/../juce_graphics/../juce_core/maths/juce_Range.h: In member function ‘bool juce::TextEditor::deleteForwards(bool)’:
../source/modules/juce_gui_basics/../juce_graphics/../juce_core/maths/juce_Range.h:133:9: warning: assuming signed overflow does not occur when assuming that (X + c) < X is always false [-Wstrict-overflow]
         if (newEnd < start)
         ^
../source/modules/juce_gui_basics/../juce_graphics/../juce_core/maths/juce_Range.h: In member function ‘bool juce::TextEditor::deleteBackwards(bool)’:
../source/modules/juce_gui_basics/../juce_graphics/../juce_core/maths/juce_Range.h:107:9: warning: assuming signed overflow does not occur when assuming that (X - c) > X is always false [-Wstrict-overflow]
         if (end < newStart)
         ^
In file included from ../source/modules/juce_gui_basics/../juce_graphics/../juce_core/juce_core.h:167:0,
                 from ../source/modules/juce_gui_basics/../juce_graphics/juce_graphics.h:28,
                 from ../source/modules/juce_gui_basics/juce_gui_basics.h:28,
                 from ../source/modules/juce_gui_basics/juce_gui_basics.cpp:41:
../source/modules/juce_gui_basics/../juce_graphics/../juce_core/maths/juce_MathsFunctions.h: In member function ‘virtual void juce::FileChooserDialogBox::ContentComponent::resized()’:
../source/modules/juce_gui_basics/../juce_graphics/../juce_core/maths/juce_MathsFunctions.h:112:116: warning: assuming signed overflow does not occur when assuming that (X - c) > X is always false [-Wstrict-overflow]
 inline Type jmin (const Type a, const Type b)                                               { return (b < a) ? b : a; }
 

 

Nothing major, but I though maybe you'd like to know.

 


#2

My ubuntu 13 distro seems to have gone tits-up - when I've got a new one running I'll try that myself, but have fixed a couple of the more obvious of those warnings.


#3

thanks.

the only remaining ones for me are the "assuming signed overflow does not occur" in TextEditor::findWordBreakAfter(int) and FileChooserDialogBox::ContentComponent::resized().

 


#4

Wow, that one really is ridiculous! The code is doing exactly what I want it to, and if the compiler can optimise away that comparison that's a good thing, not a problem. Why on earth is it bothering to warn about it??


#5

FYI: gcc-4.9 shows the same error, clang-3.4 does not.

 

(I'm not complaining, just letting you know of it)