Strange warnings when compiling amalgamated JUCE


#1

I’m getting strange warnings when compiling the amalgamated JUCE on Visual Studio 2008 in debug configuration:

2>juce\juce_amalgamated.h(1891) : warning C4291: 'void *juce::Rectangle::operator new(size_t,void *)' : no matching operator delete found; memory will not be freed if initialization throws an exception
2>        juce\juce_amalgamated.h(9601) : see declaration of 'juce::Rectangle::operator new'
2>        juce\juce_amalgamated.h(1884) : while compiling class template member function 'juce::Array<ElementType>::Array(const juce::Array<ElementType> &) throw()'
2>        with
2>        [
2>            ElementType=juce::Rectangle
2>        ]
2>        juce\juce_amalgamated.h(11615) : see reference to class template instantiation 'juce::Array<ElementType>' being compiled
2>        with
2>        [
2>            ElementType=juce::Rectangle
2>        ]
2>juce\juce_amalgamated.h(1935) : warning C4291: 'void *juce::Rectangle::operator new(size_t,void *)' : no matching operator delete found; memory will not be freed if initialization throws an exception
2>        juce\juce_amalgamated.h(9601) : see declaration of 'juce::Rectangle::operator new'
2>        juce\juce_amalgamated.h(1919) : while compiling class template member function 'const juce::Array<ElementType> &juce::Array<ElementType>::operator =(const juce::Array<ElementType> &) throw()'
2>        with
2>        [
2>            ElementType=juce::Rectangle
2>        ]
2>juce\juce_amalgamated.h(1891) : warning C4291: 'void *juce::KeyPress::operator new(size_t,void *)' : no matching operator delete found; memory will not be freed if initialization throws an exception
2>        juce\juce_amalgamated.h(9309) : see declaration of 'juce::KeyPress::operator new'
2>        juce\juce_amalgamated.h(1884) : while compiling class template member function 'juce::Array<ElementType>::Array(const juce::Array<ElementType> &) throw()'
2>        with
2>        [
2>            ElementType=juce::KeyPress
2>        ]
2>        juce\juce_amalgamated.h(12462) : see reference to class template instantiation 'juce::Array<ElementType>' being compiled
2>        with
2>        [
2>            ElementType=juce::KeyPress
2>        ]

I think this may be due to the juce_UseDebuggingNewOperator defining two “new” operators but only a “delete” one (I think the one for deleting arrays is missing, and thus the complaints above).


#2

Ah I noticed you updated the tip less than two hours ago… later than when I started struggling with updating to the latest changes


#3

Yes, sorry about that. The warnings weren’t a big deal though, I don’t think anything was actually broken.


#4

still there is a warning when compiling the VST wrapper in 64 bit mode (a returned size_t that needs to be casted to VstInt32, in my opinion)

and some errors when compiling the RTAS wrapper, due to the templating of the jmin and jmax functions.