Hi,

I have found that release 2.10 does not compile under openSuSE 11.3 x86
with gcc 4.5.0 20100604.
The reason is an impicite typecast const char* -> char *. I fixed it by
copying jtagDeviceName into a dynamic buffer and releasing it at the end
of opendev().

Patch below --------------------------------------------------
diff -rupN avarice-${Version}/src/jtag2usb.cc
avarice-${Version}_new/src/jtag2usb.cc
--- avarice-${Version}/src/jtag2usb.cc    2007-02-17 23:41:46.000000000
+0100
+++ avarice-${Version}_new/src/jtag2usb.cc    2010-11-04
12:13:59.000000000 +0100
@@ -73,6 +73,8 @@ static usb_dev_handle *opendev(const cha
   char *serno, *cp2;
   u_int16_t pid;
   size_t x;
+  char *jtagDeviceNameCopy = (char *) malloc(strlen(jtagDeviceName) + 10);
+  strcpy(jtagDeviceNameCopy, jtagDeviceName);
 
   switch (emu_type)
     {
@@ -95,7 +97,7 @@ static usb_dev_handle *opendev(const cha
    * right-to-left, so only the least significant nibbles need to be
    * specified.
    */
-  if ((serno = strchr(jtagDeviceName, ':')) != NULL)
+  if ((serno = strchr(jtagDeviceNameCopy, ':')) != NULL)
     {
       /* first, drop all colons there if any */
       cp2 = ++serno;
@@ -162,7 +164,7 @@ static usb_dev_handle *opendev(const cha
   if (!found)
   {
     printf("did not find any%s USB device \"%s\"\n",
-       serno? " (matching)": "", jtagDeviceName);
+       serno? " (matching)": "", jtagDeviceNameCopy);
     return NULL;
   }
 
@@ -188,6 +190,8 @@ static usb_dev_handle *opendev(const cha
       goto fail;
   }
 
+  if (jtagDeviceNameCopy)  free(jtagDeviceNameCopy);
+ 
   return udev;
 }
 
Patch above -------------------------------------------------


-- 

regards,

Gregor Rebel 
(Dipl. Informatiker) 

Fachhochschule Münster
Labor für Mikroelektronik 
Stegerwaldstrasse 39 
D-48565 Steinfurt 

Office +49(0)2551 962 209 
Mobile +49(0)1520 986 0636 

mailto:[email protected]


------------------------------------------------------------------------------
The Next 800 Companies to Lead America's Growth: New Video Whitepaper
David G. Thomson, author of the best-selling book "Blueprint to a 
Billion" shares his insights and actions to help propel your 
business during the next growth cycle. Listen Now!
http://p.sf.net/sfu/SAP-dev2dev
_______________________________________________
avarice-user mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/avarice-user

Reply via email to