This is the mail archive of the cygwin-talk@cygwin.com mailing list for the cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

RE: 1.5.12-1: ld (make) Error while compiling


> -----Original Message-----
> From: cygwin-talk-owner On Behalf Of Corinna Vinschen
> Sent: 15 December 2004 16:01
> To: Talk Amongst Yourselves
> Subject: Re: 1.5.12-1: ld (make) Error while compiling
> 
> On Dec 15 10:42, Christopher Faylor wrote:
> > "Oh.  i is supposed to be 47 here and it's 48, so I'll just
> > subtract 1."
> 
> That's just mad.  The right way to fix it is of course to subtract 6
> so you get 42 which is *always* correct.
> 
> 
> Corinna



  Hmm.  Given that we don't know what value i might have when we enter, we
should calculate the amount to subtract at runtime rather than just write a
constant 6, so to be really robust, shouldn't we code this as....

   int diff = (i - 42);
   i = i - diff;


    cheers, 
      DaveK
-- 
Can't think of a witty .sigline today....
 



Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]