delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/2004/03/23/08:38:39

X-Authentication-Warning: delorie.com: mail set sender to djgpp-bounces using -f
Date: Tue, 23 Mar 2004 08:37:58 -0500
Message-Id: <200403231337.i2NDbwaw006048@envy.delorie.com>
From: DJ Delorie <dj AT delorie DOT com>
To: djgpp AT delorie DOT com
In-reply-to: <opr5a5opiiwfff31@news.mad.ttd.net> (message from
=?iso-8859-15?Q?Rafael_Garc=EDa?= on Tue, 23 Mar 2004 10:23:03 +0100)
Subject: Re: strange comparison error
References: <opr49vxpzbwfff31 AT news DOT mad DOT ttd DOT net> <200403221712 DOT i2MHCeik004358 AT envy DOT delorie DOT com> <opr5a5opiiwfff31 AT news DOT mad DOT ttd DOT net>
Errors-To: nobody AT delorie DOT com
X-Mailing-List: djgpp AT delorie DOT com
X-Unsubscribes-To: listserv AT delorie DOT com

> Sorry, I don't understand. Could you please explain a bit more?  We
> are using 32 bit numbers, the size of the struct is around 100
> bytes. We should go to thousands of t_field's to reach
> overflow. Right? I have 14 here.

You don't know how close to the end of memory DJGPP put your
structures, though.

Since the printf uses pointer subtraction to print the value, you
should use pointer subtraction to do the check.  That way, any
overflow would at least be consistent.

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019