avrdude-dev
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [avrdude-dev] Fix warnings patch


From: Brian Dean
Subject: Re: [avrdude-dev] Fix warnings patch
Date: Thu, 28 Aug 2003 17:24:33 -0400
User-agent: Mutt/1.4.1i

On Thu, Aug 28, 2003 at 02:57:46PM -0600, E. Weddington wrote:

> Both size and vsize are assigned their values from rc which is defined as 
> an int in that function, do_op().
> 
> Perhaps the better thing to do would have been to change the type of size 
> and vsize from long to int, but I didn't want to second guess what the 
> intended use of these variables are for. Typecasting seemed safer.

I think I declared it a long since they represent file sizes.  More
appropriately I should have declared them off_t, but I was unsure if
that was available on all platforms.  It's unlikely that a file size
greater than 2 Gig would ever be fed into avrdude where that was not a
mistake to begin with, so it would probably be OK to delcare them as
'int' instead of 'long'.  But now that I think about it, on 32 bit
platforms 'long' is most likely going to be the same size as an 'int'.
Perhaps the more correct fix is to not overload the return value from
the various routines involved and make them always return 0 (success)
or <0 (error), and return other results by passing in their addresses
to the function.

Don't worry about making this exensive of a change right now - I'll
put that on my list for the next release.  Whichever way you want to
avoid the warning for now is fine with me.

-Brian




reply via email to

[Prev in Thread] Current Thread [Next in Thread]