Hi => all, I can't get chuck to compile using gcc-3.4.1: Reading specs from /usr/lib/gcc/powerpc-unknown-linux-gnu/3.4.1/specs Configured with: /var/tmp/portage/gcc-3.4.1/work/gcc-3.4.1/configure --prefix=/usr --bindir=/usr/powerpc-unknown-linux-gnu/gcc-bin/3.4 --includedir=/usr/lib/gcc/powerpc-unknown-linux-gnu/3.4.1/include --datadir=/usr/share/gcc-data/powerpc-unknown-linux-gnu/3.4 --mandir=/usr/share/gcc-data/powerpc-unknown-linux-gnu/3.4/man --infodir=/usr/share/gcc-data/powerpc-unknown-linux-gnu/3.4/info --enable-shared --host=powerpc-unknown-linux-gnu --target=powerpc-unknown-linux-gnu --with-system-zlib --enable-languages=c,c++,f77 --enable-threads=posix --enable-long-long --disable-checking --disable-libunwind-exceptions --enable-cstdio=stdio --enable-version-specific-runtime-libs --with-gxx-include-dir=/usr/lib/gcc/powerpc-unknown-linux-gnu/3.4.1/include/g++-v3 --with-local-prefix=/usr/local --disable-werror --enable-shared --enable-nls --without-included-gettext --disable-multilib --enable-__cxa_atexit --enable-clocale=gnu Thread model: posix gcc version 3.4.1 (Gentoo Linux 3.4.1, ssp-3.4-2, pie-8.7.6.3) error as follows: gcc -D__LINUX_ALSA__ -O3 -g -c chuck_instr.cpp chuck_instr.cpp: In member function `virtual void Chuck_Instr_Lt_single::execute(Chuck_VM*, Chuck_VM_Shred*)': chuck_instr.cpp:1337: error: ISO C++ forbids cast to non-reference type used as lvalue and so on for lines 1337, 1365, 1379, 1392, 1406, 1420, 1434, 1448, 1462, 1475, 1489 sorry, my (almost non.existing) c++-knowledge doesn't suffice to debug this. compiler bug or real standard violation? gcc-3.3.4 compiles it cleanly, but it uses another libstdc++ ... Cheers, Niklas -- Computer Music PhD-student University of Waikato Hamilton New Zealand
Hi => Niklas! interesting... try this: change line 49 to: #define push_uint( sp, val ) *((uint*&)sp) = val; ((uint*&)sp)++ Does this fix it? Best, Ge! On Sunday, July 11, 2004, at 11:10 PM, Niklas Werner wrote:
Hi => all,
I can't get chuck to compile using gcc-3.4.1:
Reading specs from /usr/lib/gcc/powerpc-unknown-linux-gnu/3.4.1/specs Configured with: /var/tmp/portage/gcc-3.4.1/work/gcc-3.4.1/configure --prefix=/usr --bindir=/usr/powerpc-unknown-linux-gnu/gcc-bin/3.4 --includedir=/usr/lib/gcc/powerpc-unknown-linux-gnu/3.4.1/include --datadir=/usr/share/gcc-data/powerpc-unknown-linux-gnu/3.4 --mandir=/usr/share/gcc-data/powerpc-unknown-linux-gnu/3.4/man --infodir=/usr/share/gcc-data/powerpc-unknown-linux-gnu/3.4/info --enable-shared --host=powerpc-unknown-linux-gnu --target=powerpc-unknown-linux-gnu --with-system-zlib --enable-languages=c,c++,f77 --enable-threads=posix --enable-long-long --disable-checking --disable-libunwind-exceptions --enable-cstdio=stdio --enable-version-specific-runtime-libs --with-gxx-include-dir=/usr/lib/gcc/powerpc-unknown-linux-gnu/3.4.1/ include/g++-v3 --with-local-prefix=/usr/local --disable-werror --enable-shared --enable-nls --without-included-gettext --disable-multilib --enable-__cxa_atexit --enable-clocale=gnu Thread model: posix gcc version 3.4.1 (Gentoo Linux 3.4.1, ssp-3.4-2, pie-8.7.6.3)
error as follows:
gcc -D__LINUX_ALSA__ -O3 -g -c chuck_instr.cpp chuck_instr.cpp: In member function `virtual void Chuck_Instr_Lt_single::execute(Chuck_VM*, Chuck_VM_Shred*)': chuck_instr.cpp:1337: error: ISO C++ forbids cast to non-reference type used as lvalue
and so on for lines 1337, 1365, 1379, 1392, 1406, 1420, 1434, 1448, 1462, 1475, 1489
sorry, my (almost non.existing) c++-knowledge doesn't suffice to debug this. compiler bug or real standard violation?
gcc-3.3.4 compiles it cleanly, but it uses another libstdc++ ...
Cheers,
Niklas -- Computer Music PhD-student University of Waikato Hamilton New Zealand _______________________________________________ chuck-dev mailing list chuck-dev@lists.cs.princeton.edu https://lists.cs.princeton.edu/mailman/listinfo/chuck-dev
On Mon, 12 Jul 2004 15:23, Ge Wang wrote:
change line 49 to:
#define push_uint( sp, val ) *((uint*&)sp) = val; ((uint*&)sp)++
Does this fix it?
yes. BUT: gcc -D__LINUX_ALSA__ -O3 -g -c ugen_osc.cpp ugen_osc.cpp: In function `void sinosc_cget_freq(double, void*, void*)': ugen_osc.cpp:179: error: ISO C++ forbids cast to non-reference type used as lvalue and several more related to the set of macros SET_NEXT_*() and GET_NEXT_*() changing all of them accordingly to: #define SET_NEXT_FLOAT(ptr,v) (*((t_CKFLOAT *&)ptr)++=v) etc. makes chuck compile and run with gcc-3.4.1 (I just quickly ran the examples, not sure whether this breaks anything else.) Cheers, Niklas -- Computer Music PhD-student University of Waikato Hamilton New Zealand
This is an interesting error. We can't treat the sp and pointer variables as lvalues to do assignments when we cast to non-reference pointers. This makes sense, it is interesting that gcc just now decided to care. Thanks Niklas. Best, Ge! On Jul 12, 2004, at 12:07 AM, Niklas Werner wrote:
On Mon, 12 Jul 2004 15:23, Ge Wang wrote:
change line 49 to:
#define push_uint( sp, val ) *((uint*&)sp) = val; ((uint*&)sp)++
Does this fix it?
yes.
BUT: gcc -D__LINUX_ALSA__ -O3 -g -c ugen_osc.cpp ugen_osc.cpp: In function `void sinosc_cget_freq(double, void*, void*)': ugen_osc.cpp:179: error: ISO C++ forbids cast to non-reference type used as lvalue
and several more related to the set of macros SET_NEXT_*() and GET_NEXT_*() changing all of them accordingly to:
#define SET_NEXT_FLOAT(ptr,v) (*((t_CKFLOAT *&)ptr)++=v)
etc. makes chuck compile and run with gcc-3.4.1 (I just quickly ran the examples, not sure whether this breaks anything else.)
Cheers,
Niklas -- Computer Music PhD-student University of Waikato Hamilton New Zealand _______________________________________________ chuck-dev mailing list chuck-dev@lists.cs.princeton.edu https://lists.cs.princeton.edu/mailman/listinfo/chuck-dev
participants (2)
-
Ge Wang
-
Niklas Werner