Reports of last svn tip with gcc 4.3.3


#1

Errors:

platform_specific_code/juce_linux_Audio.cpp:451: error: no matching function for call to ‘jlimit(unsigned int&, unsigned int&, int)’
platform_specific_code/juce_linux_Audio.cpp:472: error: no matching function for call to ‘jlimit(unsigned int&, unsigned int&, int)’

Warnings:

../../src/juce_appframework/gui/graphics/imaging/../../../../juce_core/containers/juce_SparseSet.h: In member function ‘void juce::Image::createSolidAreaMask(juce::RectangleList&, float) const’:
../../src/juce_appframework/gui/graphics/imaging/../../../../juce_core/containers/juce_SparseSet.h:234: warning: assuming signed overflow does not occur when assuming that (X + c) < X is always false

../../src/juce_appframework/gui/graphics/imaging/../../../../juce_core/containers/juce_SparseSet.h:234: warning: assuming signed overflow does not occur when assuming that (X + c) < X is always false

../../src/juce_appframework/gui/graphics/imaging/image_file_formats/juce_PNGLoader.cpp:69:1: warning: "Byte" redefined
In file included from ../../src/juce_appframework/gui/graphics/imaging/image_file_formats/../../../../../juce_core/io/streams/zlib/zlib.h:34,
                 from ../../src/juce_appframework/gui/graphics/imaging/image_file_formats/juce_PNGLoader.cpp:44:
../../src/juce_appframework/gui/graphics/imaging/image_file_formats/../../../../../juce_core/io/streams/zlib/zconf.h:59:1: warning: this is the location of the previous definition

../../src/juce_appframework/gui/components/controls/../../../../juce_core/containers/juce_SparseSet.h: In member function ‘void juce::ListBox::selectRowInternal(int, bool, bool, bool)’:
../../src/juce_appframework/gui/components/controls/../../../../juce_core/containers/juce_SparseSet.h:234: warning: assuming signed overflow does not occur when assuming that (X + c) < X is always false

In file included from platform_specific_code/juce_linux_NamedPipe.cpp:32:
platform_specific_code/../../macosx/platform_specific_code/juce_mac_NamedPipe.cpp: In member function ‘void juce::NamedPipe::cancelPendingReads()’:
platform_specific_code/../../macosx/platform_specific_code/juce_mac_NamedPipe.cpp:73: warning: ignoring return value of ‘ssize_t write(int, const void*, size_t)’, declared with attribute warn_unused_result
juce_linux_Files.cpp
platform_specific_code/juce_linux_Files.cpp: In static member function ‘static const juce::File juce::File::getCurrentWorkingDirectory()’:
platform_specific_code/juce_linux_Files.cpp:288: warning: ignoring return value of ‘char* getcwd(char*, size_t)’, declared with attribute warn_unused_result

Cheers !


#2

Thanks for those.

Although the sparse set warning is ridiculous! Basically I’ve got the code

int a = b + c; // where c is always > 0 if (a < b) // checking for an overflow etc..

and it’s saying that the condition is always false - but that’s bollocks! If b = 0x7fffffff and c = 0x7fffffff, then a = -2… What were the compiler writers smoking when they added that??

But I don’t know how I could tweak it to stop the compiler making its bogus assumption!


#3

yeah that warning is sounding strange for me too…

probably they smoked a joypad before thinking about it !


#4

It needs to be fixed though - if it makes that assumption, the code will fail.

I’ve not got gcc4.3.3 here, but maybe you could see if this variation fools it?

[code] void removeRange (const Type firstValue,
const Type numValuesToRemove) throw()
{
jassert (numValuesToRemove >= 0);

    if (numValuesToRemove != 0
         && firstValue < values.getLast())
    {

[/code]


#5

i wanted to try/help but my compilation breaks on those jlimit errors and i can’t get any further that that, is there a quick fix for those ?


#6

Thought I’d already fixed those… Maybe I’ve not checked it in yet. Very easy to fix by casting the parameters to ints.


#7

ok i did the casts, build is ok but i get a segfault when starting the audio host demo (nog ui shows)

a few last line of strace

close(5)                                = 0
ioctl(6, AGPIOC_ACQUIRE or APM_IOC_STANDBY, 0xbfc3f7a4) = 0
fcntl64(6, F_GETFL)                     = 0x2802 (flags O_RDWR|O_NONBLOCK|O_ASYNC)
ioctl(6, AGPIOC_INFO, 0xbfc3f7a0)       = 0
clock_gettime(CLOCK_MONOTONIC, {350214, 477306808}) = 0
ioctl(6, AGPIOC_SETUP, 0xbfc3f798)      = 0
mmap2(NULL, 4096, PROT_READ, MAP_SHARED, 6, 0x80000) = 0xb7f20000
mmap2(NULL, 4096, PROT_READ|PROT_WRITE, MAP_SHARED, 6, 0x81000) = 0xb7f1f000
ioctl(6, 0xc25c4110, 0xbfc3f9b0)        = 0
ioctl(6, 0xc25c4110, 0xbfc3f9b0)        = 0
ioctl(6, 0xc25c4110, 0xbfc3f6fc)        = 0
ioctl(6, 0xc25c4110, 0xbfc3f9b0)        = 0
ioctl(6, 0xc25c4110, 0xbfc3f6fc)        = 0
ioctl(6, 0xc25c4110, 0xbfc3f9b0)        = 0
ioctl(6, 0xc25c4110, 0xbfc3f6fc)        = 0
ioctl(6, 0xc25c4110, 0xbfc3f9b0)        = 0
ioctl(6, 0xc25c4110, 0xbfc3f6fc)        = 0
ioctl(6, 0xc25c4110, 0xbfc3f9b0)        = 0
ioctl(6, 0xc25c4110, 0xbfc3f6fc)        = 0
ioctl(6, 0xc25c4110, 0xbfc3f9b0)        = 0
ioctl(6, 0xc25c4110, 0xbfc3f6fc)        = 0
ioctl(6, 0xc25c4110, 0xbfc3f9b0)        = 0
ioctl(6, 0xc25c4110, 0xbfc3f9b0)        = 0
close(6)                                = 0
munmap(0xb7f20000, 4096)                = 0
munmap(0xb7f1f000, 4096)                = 0
ioctl(4, 0xc1205531, 0xbfc3fc70)        = 0
stat64("/usr/share/alsa/alsa.conf", {st_mode=S_IFREG|0644, st_size=9035, ...}) = 0
open("/dev/snd/controlC0", O_RDONLY)    = 5
close(5)                                = 0
open("/dev/snd/controlC0", O_RDWR)      = 5
ioctl(5, USBDEVFS_CONTROL, 0xbfc3f8f4)  = 0
ioctl(5, UI_DEV_CREATE, 0xbfc3f960)     = 0
close(5)                                = 0
open("/dev/snd/controlC0", O_RDWR)      = 5
ioctl(5, USBDEVFS_CONTROL, 0xbfc3f924)  = 0
ioctl(5, 0x40045532, 0xbfc3f944)        = 0
open("/dev/snd/pcmC0D0c", O_RDWR|O_NONBLOCK|O_ASYNC) = 6
close(5)                                = 0
ioctl(6, AGPIOC_ACQUIRE or APM_IOC_STANDBY, 0xbfc3f7a4) = 0
fcntl64(6, F_GETFL)                     = 0x2802 (flags O_RDWR|O_NONBLOCK|O_ASYNC)
ioctl(6, AGPIOC_INFO, 0xbfc3f7a0)       = 0
clock_gettime(CLOCK_MONOTONIC, {350214, 482459565}) = 0
ioctl(6, AGPIOC_SETUP, 0xbfc3f798)      = 0
mmap2(NULL, 4096, PROT_READ, MAP_SHARED, 6, 0x80000) = 0xb7f20000
mmap2(NULL, 4096, PROT_READ|PROT_WRITE, MAP_SHARED, 6, 0x81000) = 0xb7f1f000
ioctl(6, 0xc25c4110, 0xbfc3f9b0)        = 0
close(6)                                = 0
munmap(0xb7f20000, 4096)                = 0
munmap(0xb7f1f000, 4096)                = 0
close(4)                                = 0
--- SIGSEGV (Segmentation fault) @ 0 (0) ---
+++ killed by SIGSEGV +++
Process 26845 detached

i also tried builidng the plugin itself, and i got a build error

../../../wrapper/VST/juce_VST_Wrapper.cpp:361:29: warning: multi-character character constant
In file included from /home/atom/devel/vstsdk2.4/public.sdk/source/vst2.x/audioeffect.h:16,
                 from /home/atom/devel/vstsdk2.4/public.sdk/source/vst2.x/audioeffectx.h:17,
                 from ../../../wrapper/VST/juce_VST_Wrapper.cpp:68:
/home/atom/devel/vstsdk2.4/pluginterfaces/vst2.x/aeffect.h:125: error: expected `)' before ‘*’ token
/home/atom/devel/vstsdk2.4/pluginterfaces/vst2.x/aeffect.h:126: error: expected `)' before ‘*’ token
/home/atom/devel/vstsdk2.4/pluginterfaces/vst2.x/aeffect.h:127: error: expected `)' before ‘*’ token
/home/atom/devel/vstsdk2.4/pluginterfaces/vst2.x/aeffect.h:128: error: expected `)' before ‘*’ token
/home/atom/devel/vstsdk2.4/pluginterfaces/vst2.x/aeffect.h:129: error: expected `)' before ‘*’ token
/home/atom/devel/vstsdk2.4/pluginterfaces/vst2.x/aeffect.h:130: error: expected `)' before ‘*’ token
/home/atom/devel/vstsdk2.4/pluginterfaces/vst2.x/aeffect.h:149: error: ‘AEffectDispatcherProc’ does not name a type
/home/atom/devel/vstsdk2.4/pluginterfaces/vst2.x/aeffect.h:152: error: ‘AEffectProcessProc’ does not name a type
/home/atom/devel/vstsdk2.4/pluginterfaces/vst2.x/aeffect.h:155: error: ‘AEffectSetParameterProc’ does not name a type
/home/atom/devel/vstsdk2.4/pluginterfaces/vst2.x/aeffect.h:158: error: ‘AEffectGetParameterProc’ does not name a type
/home/atom/devel/vstsdk2.4/pluginterfaces/vst2.x/aeffect.h:183: error: ‘AEffectProcessProc’ does not name a type
/home/atom/devel/vstsdk2.4/pluginterfaces/vst2.x/aeffect.h:187: error: ‘AEffectProcessDoubleProc’ does not name a type
In file included from /home/atom/devel/vstsdk2.4/public.sdk/source/vst2.x/audioeffectx.h:17,
                 from ../../../wrapper/VST/juce_VST_Wrapper.cpp:68:
/home/atom/devel/vstsdk2.4/public.sdk/source/vst2.x/audioeffect.h:27: error: expected `)' before ‘audioMaster’
/home/atom/devel/vstsdk2.4/public.sdk/source/vst2.x/audioeffect.h:155: error: ‘audioMasterCallback’ does not name a type
In file included from ../../../wrapper/VST/juce_VST_Wrapper.cpp:68:
/home/atom/devel/vstsdk2.4/public.sdk/source/vst2.x/audioeffectx.h:27: error: expected `)' before ‘audioMaster’
In file included from ../../../wrapper/VST/juce_VST_Wrapper.cpp:70:
/home/atom/devel/vstsdk2.4/public.sdk/source/vst2.x/audioeffectx.cpp:57: error: expected `)' before ‘audioMaster’
/home/atom/devel/vstsdk2.4/public.sdk/source/vst2.x/audioeffectx.cpp: In member function ‘virtual void AudioEffectX::resume()’:
/home/atom/devel/vstsdk2.4/public.sdk/source/vst2.x/audioeffectx.cpp:307: warning: deprecated conversion from string constant to ‘char*’
/home/atom/devel/vstsdk2.4/public.sdk/source/vst2.x/audioeffectx.cpp: In member function ‘virtual void AudioEffectX::__wantEventsDeprecated(VstInt32)’:
/home/atom/devel/vstsdk2.4/public.sdk/source/vst2.x/audioeffectx.cpp:314: error: ‘audioMaster’ was not declared in this scope
/home/atom/devel/vstsdk2.4/public.sdk/source/vst2.x/audioeffectx.cpp: In member function ‘virtual VstTimeInfo* AudioEffectX::getTimeInfo(VstInt32)’:
/home/atom/devel/vstsdk2.4/public.sdk/source/vst2.x/audioeffectx.cpp:336: error: ‘audioMaster’ was not declared in this scope
/home/atom/devel/vstsdk2.4/public.sdk/source/vst2.x/audioeffectx.cpp: In member function ‘virtual VstInt32 AudioEffectX::__tempoAtDeprecated(VstInt32)’:
/home/atom/devel/vstsdk2.4/public.sdk/source/vst2.x/audioeffectx.cpp:347: error: ‘audioMaster’ was not declared in this scope
/home/atom/devel/vstsdk2.4/public.sdk/source/vst2.x/audioeffectx.cpp: In member function ‘bool AudioEffectX::sendVstEventsToHost(VstEvents*)’:
/home/atom/devel/vstsdk2.4/public.sdk/source/vst2.x/audioeffectx.cpp:361: error: ‘audioMaster’ was not declared in this scope
/home/atom/devel/vstsdk2.4/public.sdk/source/vst2.x/audioeffectx.cpp: In member function ‘virtual VstInt32 AudioEffectX::__getNumAutomatableParametersDeprec
/home/atom/devel/vstsdk2.4/public.sdk/source/vst2.x/audioeffectx.cpp:419: error: ‘audioMaster’ was not declared in this scope
/home/atom/devel/vstsdk2.4/public.sdk/source/vst2.x/audioeffectx.cpp: In member function ‘virtual VstInt32 AudioEffectX::__getParameterQuantizationDeprecate
/home/atom/devel/vstsdk2.4/public.sdk/source/vst2.x/audioeffectx.cpp:427: error: ‘audioMaster’ was not declared in this scope
/home/atom/devel/vstsdk2.4/public.sdk/source/vst2.x/audioeffectx.cpp: In member function ‘virtual bool AudioEffectX::ioChanged()’:
/home/atom/devel/vstsdk2.4/public.sdk/source/vst2.x/audioeffectx.cpp:448: error: ‘audioMaster’ was not declared in this scope
/home/atom/devel/vstsdk2.4/public.sdk/source/vst2.x/audioeffectx.cpp: In member function ‘virtual bool AudioEffectX::__needIdleDeprecated()’:
/home/atom/devel/vstsdk2.4/public.sdk/source/vst2.x/audioeffectx.cpp:456: error: ‘audioMaster’ was not declared in this scope
/home/atom/devel/vstsdk2.4/public.sdk/source/vst2.x/audioeffectx.cpp: In member function ‘virtual bool AudioEffectX::sizeWindow(VstInt32, VstInt32)’:
/home/atom/devel/vstsdk2.4/public.sdk/source/vst2.x/audioeffectx.cpp:469: error: ‘audioMaster’ was not declared in this scope
/home/atom/devel/vstsdk2.4/public.sdk/source/vst2.x/audioeffectx.cpp: In member function ‘virtual double AudioEffectX::updateSampleRate()’:
/home/atom/devel/vstsdk2.4/public.sdk/source/vst2.x/audioeffectx.cpp:480: error: ‘audioMaster’ was not declared in this scope
/home/atom/devel/vstsdk2.4/public.sdk/source/vst2.x/audioeffectx.cpp: In member function ‘virtual VstInt32 AudioEffectX::updateBlockSize()’:
/home/atom/devel/vstsdk2.4/public.sdk/source/vst2.x/audioeffectx.cpp:497: error: ‘audioMaster’ was not declared in this scope
/home/atom/devel/vstsdk2.4/public.sdk/source/vst2.x/audioeffectx.cpp: In member function ‘virtual VstInt32 AudioEffectX::getInputLatency()’:
/home/atom/devel/vstsdk2.4/public.sdk/source/vst2.x/audioeffectx.cpp:513: error: ‘audioMaster’ was not declared in this scope
/home/atom/devel/vstsdk2.4/public.sdk/source/vst2.x/audioeffectx.cpp: In member function ‘virtual VstInt32 AudioEffectX::getOutputLatency()’:
/home/atom/devel/vstsdk2.4/public.sdk/source/vst2.x/audioeffectx.cpp:529: error: ‘audioMaster’ was not declared in this scope
/home/atom/devel/vstsdk2.4/public.sdk/source/vst2.x/audioeffectx.cpp: In member function ‘virtual AEffect* AudioEffectX::__getPreviousPlugDeprecated(VstInt3
/home/atom/devel/vstsdk2.4/public.sdk/source/vst2.x/audioeffectx.cpp:625: error: ‘audioMaster’ was not declared in this scope

#8

vstsdk2.4 doesn’t compile straight on linux due to a typo. do this in juce_VstWrapper.cpp:

//==============================================================================
/*  These files come with the Steinberg VST SDK - to get them, you'll need to
    visit the Steinberg website and jump through some hoops to sign up as a
    VST developer.

    Then, you'll need to make sure your include path contains your "vstsdk2.3" or
    "vstsdk2.4" directory.

    Note that the JUCE_USE_VSTSDK_2_4 macro should be defined in JucePluginCharacteristics.h
*/
#if JUCE_USE_VSTSDK_2_4
 // VSTSDK V2.4 includes.. (public.sdk/source/vst2.x)
 #include "public.sdk/source/vst2.x/audioeffectx.h"
 #include "public.sdk/source/vst2.x/aeffeditor.h"
 #include "public.sdk/source/vst2.x/audioeffectx.cpp"
 #include "public.sdk/source/vst2.x/audioeffect.cpp"

 #if JUCE_LINUX
  #define __cdecl
 #endif
 
 #if ! VST_2_4_EXTENSIONS
  /* You probably are trying to include a wrong VSTSDK version != 2.4 */
  #error
 #endif
 
#else
 // VSTSDK V2.3 includes.. (source/common)
 #include "source/common/audioeffectx.h"
 #include "source/common/AEffEditor.hpp"
 #include "source/common/audioeffectx.cpp"
 #include "source/common/AudioEffect.cpp"

 #if ! VST_2_3_EXTENSIONS || VST_2_4_EXTENSIONS
  /* You probably are trying to include a wrong VSTSDK version != 2.3  */
  #error
 #endif

 typedef long VstInt32;
 typedef long VstIntPtr;
 enum Vst2StringConstants
 {
   kVstMaxNameLen       = 64,
   kVstMaxLabelLen      = 64,
   kVstMaxShortLabelLen = 8,
   kVstMaxCategLabelLen = 24,
   kVstMaxFileNameLen   = 100
 };

 enum VstSmpteFrameRate
 {
    kVstSmpte24fps    = 0,  ///< 24 fps
    kVstSmpte25fps    = 1,  ///< 25 fps
    kVstSmpte2997fps  = 2,  ///< 29.97 fps
    kVstSmpte30fps    = 3,  ///< 30 fps
    kVstSmpte2997dfps = 4,  ///< 29.97 drop
    kVstSmpte30dfps   = 5,  ///< 30 drop
    kVstSmpteFilm16mm = 6,  ///< Film 16mm
    kVstSmpteFilm35mm = 7,  ///< Film 35mm
    kVstSmpte239fps   = 10, ///< HDTV: 23.976 fps
    kVstSmpte249fps   = 11, ///< HDTV: 24.976 fps
    kVstSmpte599fps   = 12, ///< HDTV: 59.94 fps
    kVstSmpte60fps    = 13  ///< HDTV: 60 fps
 };
#endif

#9

i forgot about the cdecl stuff, sorry for this, scratch that build error.


#10

Cool, thanks for that!


#11

[quote=“jules”]
But I don’t know how I could tweak it to stop the compiler making its bogus assumption![/quote]

Hi Jules,

gcc is right indeed, the signed ints are not forced to wrap-around by the C/C++ standard (behaviour of ints when overflowing is undefined) , so gcc is free to optimize the condition to always true.

I think the -fno-strict-overflow is what should be used to force the compiler to still assume integer wrapping (see the discussion on http://gcc.gnu.org/onlinedocs/gcc-4.3.3/gcc/Optimize-Options.html , -fstric-overflow )

Note also that unsigned integers do always wrap on overflow, so in your case declaring a,b and c as unsigned should not trigger the warning


#12

That’s terrifying!

Ok, I’ve found a way to restructure the original SparseSet code to avoid the issue, but it’s a good c++ brain teaser!