Hi Ed, Well, I would think that we need to take a look at the usage of the default_target variable. Is it really used as a variable, i.e., is it reassigned another value elsewhere in the program? If not, then I would think that it would be safe to say that it can be declared a "const char *", a constant string, with the value given.
Overall, since the warnings.patch file is to fix warnings, I think it might be prudent to rebuild avarice from CVS and see what the actual warnings are these days (I've been trying to do just that recently to help you out, but I'm running into some Bootstrap issues, and Joerg is helping me out with this offline). We should see if the patch file fixes any of the currently existing warnings and we should just fix those, rather than blindly applying the patch. I don't always assume that the patch does the right thing, especially if the code has changed over time and the patch is a bit stale. Eric > -----Original Message----- > From: Ed [mailto:[email protected]] > Sent: Thursday, March 17, 2011 5:11 PM > To: [email protected] > Subject: [AVaRICE-user] Patching Avarice > > All: > Here is another problem with the bundle of Avarice patches, this patch > "warnings.patch" has a problem at line 198 of the patch file. The > patch process barfs on hunk #3 with an error: (Hunk #3 FAILED at 244. > 1 out of 3 hunks FAILED -- saving rejects to file src/ > jtag2prog.cc.rej). It appears the Avarice file src/jtag2prog.cc and > the patch file disagree as to what is and what is supposed to be > witness: > > warnings.patch starting at line # 198: > > @@ -246,8 +244,8 @@ > // Basically, we just open the file and copy blocks over to the > JTAG > // box. > struct stat ifstat; > - char *target = NULL; > - char *default_target = "binary"; > + const char *target = NULL; > + const char *default_target = "binary"; > unsigned int page_size; > bool done = 0; > bfd *file; > > This is the relevant sections of the file to be patched /src/ > jtag2prog.cc are: > > // Basically, we just open the file and copy blocks over to the > JTAG > // box. > struct stat ifstat; > char *target = NULL; > char default_target[] = "binary"; > unsigned int page_size; > bool done = 0; > bfd *file; > > This section of code was previously patched by another file called > "avarice-string-warning.patch". Here is the relevant patch from the > patch file: > > RCS file: /cvsroot/avarice/avarice/src/jtag2prog.cc,v > retrieving revision 1.3 > diff -u -r1.3 jtag2prog.cc > --- jtag2prog.cc 8 Aug 2006 21:27:34 -0000 1.3 > +++ jtag2prog.cc 21 Aug 2009 21:00:40 -0000 > @@ -247,7 +247,7 @@ > // box. > struct stat ifstat; > char *target = NULL; > - char *default_target = "binary"; > + char default_target[] = "binary"; > unsigned int page_size; > bool done = 0; > bfd *file; > > Its looks to me that the change is changing an array called > default_target to a constant char pointer called default_target. > > The question is, which patch is correct? Are they both correct? > > TIA, > Ed > > > -------------------------------------------------------------------------- > ---- > Colocation vs. Managed Hosting > A question and answer guide to determining the best fit > for your organization - today and in the future. > http://p.sf.net/sfu/internap-sfd2d > _______________________________________________ > avarice-user mailing list > [email protected] > https://lists.sourceforge.net/lists/listinfo/avarice-user ------------------------------------------------------------------------------ Colocation vs. Managed Hosting A question and answer guide to determining the best fit for your organization - today and in the future. http://p.sf.net/sfu/internap-sfd2d _______________________________________________ avarice-user mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/avarice-user
