AtomicTester<Type>::testInteger() fails, OSX 64 bit


#1

Hi,

donwloaded the latest tip. Just one problem left while building a 64 bit AU. The unit test fails in 64 bit:

/Users/patrickkunz/Develop/workspace-svn-mac/tal-elek7ro-juce/MacAudioUnit64/../juce/juce_amalgamated.cpp:2240:0 /Users/patrickkunz/Develop/workspace-svn-mac/tal-elek7ro-juce/MacAudioUnit64/../juce/juce_amalgamated.cpp:2240: instantiated from 'static void juce::SimpleUnitTests::AtomicTester<Type>::testInteger() [with Type = void*]' /Users/patrickkunz/Develop/workspace-svn-mac/tal-elek7ro-juce/MacAudioUnit64/../juce/juce_amalgamated.cpp:2333:0 /Users/patrickkunz/Develop/workspace-svn-mac/tal-elek7ro-juce/MacAudioUnit64/../juce/juce_amalgamated.cpp:2333: instantiated from here /Users/patrickkunz/Develop/workspace-svn-mac/tal-elek7ro-juce/MacAudioUnit64/../juce/juce_amalgamated.h:5967:0 /Users/patrickkunz/Develop/workspace-svn-mac/tal-elek7ro-juce/MacAudioUnit64/../juce/juce_amalgamated.h:5967: error: cast from 'void*' to 'int32_t' loses precision /Users/patrickkunz/Develop/workspace-svn-mac/tal-elek7ro-juce/MacAudioUnit64/../juce/juce_amalgamated.cpp:2240:0 /Users/patrickkunz/Develop/workspace-svn-mac/tal-elek7ro-juce/MacAudioUnit64/../juce/juce_amalgamated.cpp:2240: instantiated from 'static void juce::SimpleUnitTests::AtomicTester<Type>::testInteger() [with Type = int*]' /Users/patrickkunz/Develop/workspace-svn-mac/tal-elek7ro-juce/MacAudioUnit64/../juce/juce_amalgamated.cpp:2334:0 /Users/patrickkunz/Develop/workspace-svn-mac/tal-elek7ro-juce/MacAudioUnit64/../juce/juce_amalgamated.cpp:2334: instantiated from here /Users/patrickkunz/Develop/workspace-svn-mac/tal-elek7ro-juce/MacAudioUnit64/../juce/juce_amalgamated.h:5967:0 /Users/patrickkunz/Develop/workspace-svn-mac/tal-elek7ro-juce/MacAudioUnit64/../juce/juce_amalgamated.h:5967: error: cast from 'int*' to 'int32_t' loses precision /Users/patrickkunz/Develop/workspace-svn-mac/tal-elek7ro-juce/MacAudioUnit64/../juce/juce_amalgamated.cpp:0:0 /Users/patrickkunz/Develop/workspace-svn-mac/tal-elek7ro-juce/MacAudioUnit64/../juce/juce_amalgamated.cpp: At global scope:

Is there really an issue or is the unit test not up to date?


#2

The tests all work fine in my 64-bit builds… Can you tell me exactly which architecture, base SDK and compatibility version you’re using?


#3

Its a 64 bit only build. I used “64 bit Intel” Base Architekture with OSX 10.6 SDK and gcc 4.0. Mac OSX deploment target 10.6. MACOSX_DEPLOYMENT_TARGET_ppc is set to 10.5 (think thats not relevant for this build). All configurations done in the project build settings.

Its great that a C++ programmer makes some kind of unit tests, thanks for that effort!


#4

Ah, it’ll be because you’re using gcc4.0, which doesn’t have a full set of atomic ops. The only reason to use gcc4.0 would be if you’re building with the 10.4 SDK. If you’re using 10.5 or later, gcc4.2 is a better choice.


#5

I’m not happy with gcc 4.2. Couldnt compile the amagamated files in a useful time. Have only 2GB Ram and my system begins to swap very soon. Had to interrupt the build after 30 minutes. I’m not the only one that has such problems, its a known compiler “problem”:

https://bugs.launchpad.net/ubuntu/+source/gcc-4.2/+bug/187391

Hope they will fix that in gcc 4.3, otherwise i have to buy a new mac :frowning:

Works without any problem with gcc 4.0.


#6

Ah, yes, I sometimes see that problem too, though it does seem to be intermittent for me.

Ok, I’ll see if I can fix the compile problem, it’s probably nothing very serious.


#7

[quote=“jules”]Ah, yes, I sometimes see that problem too, though it does seem to be intermittent for me.

Ok, I’ll see if I can fix the compile problem, it’s probably nothing very serious.[/quote]

Thought the gcc people should fix that issue. But if you can do something i’m happy too.


#8

Oh, I meant I’d try to get the atomics to compile, I didn’t mean I’d sort out gcc!