Csound Csound-dev Csound-tekno Search About

[Cs-dev] Swig 1.3.31 insufficient

Date2007-01-10 11:53
FromJohn ffitch
Subject[Cs-dev] Swig 1.3.31 insufficient
I am back to the invalid C++ being generated by SWIG.  
frontends/CsoundVST/CsoundVST_wrap.cc:29870: error: ISO C++ forbids assignment of arrays


I have tried reporting this to the SWIG people but they want a 9 line
program that breaks and apart from having to do with vargs I do not
know what code generates this.  In practice new each version of SWIG
adds more layers of obscuration so I no longer know how to hand-edit
this to working code.  Does anyone know where the function
_wrap_Counterpoint_message__SWIG_1
comes from, and/or what the lines
      va_list * temp = reinterpret_cast< va_list * >(argp3);
      arg3 = *temp;
mean?  It is the assignment to arg3 that is illegal.  Should I replace
it with a memcopy?  It makes it compile but who knows?


next problem is

frontends/CsoundVST/CsoundVST.cpp: In member function 'virtual int CsoundVST::perform()':
frontends/CsoundVST/CsoundVST.cpp:342: error: cast from 'void*' to 'int' loses precision
scons: *** [frontends/CsoundVST/CsoundVST.os] Error 1

==John ffitch

-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys - and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
Csound-devel mailing list
Csound-devel@lists.sourceforge.net

Date2007-01-10 20:36
FromErik de Castro Lopo
SubjectRe: [Cs-dev] Swig 1.3.31 insufficient
John ffitch wrote:

> next problem is
> 
> frontends/CsoundVST/CsoundVST.cpp: In member function 'virtual int CsoundVST::perform()':
> frontends/CsoundVST/CsoundVST.cpp:342: error: cast from 'void*' to 'int' loses precision
> scons: *** [frontends/CsoundVST/CsoundVST.os] Error 1

The above is a disaster waiting to happen on 64 bit systems. On many
64 bit systems, sizeof (void*) == 8 and sizeof (int) == 4 which means
that casting from void* to int is a lossy operation.

Erik
-- 
+-----------------------------------------------------------+
  Erik de Castro Lopo
+-----------------------------------------------------------+
"TURKEY'S public television TRT, controlled by the Islamist-rooted government,
has barred the popular Walt Disney cartoon Winnie the Pooh from air because
it has a piglet as one of its main heroes"
-- http://www.news.com.au/story/0,10117,19503274-1702,00.html

-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys - and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
Csound-devel mailing list
Csound-devel@lists.sourceforge.net