delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/2000/05/23/14:00:26

From: buers AT gmx DOT de (Dieter Buerssner)
Newsgroups: comp.os.msdos.djgpp
Subject: Re: C++, complex, etc
Date: 23 May 2000 17:57:25 GMT
Lines: 18
Message-ID: <8geo6n.3vs6dg1.0@buerssner-17104.user.cis.dfn.de>
References: <0rneisomj48fm3khdpdodsilqpndjqd7do AT 4ax DOT com> <Pine DOT SUN DOT 3 DOT 91 DOT 1000522093304 DOT 22890H-100000 AT is> <1osjis87hetlomjooiv6prc0iev46cncdt AT 4ax DOT com> <200005230314 DOT XAA01009 AT envy DOT delorie DOT com> <8gdbeu$dke$1 AT antares DOT lu DOT erisoft DOT se>
NNTP-Posting-Host: pec-107-56.tnt6.s2.uunet.de (149.225.107.56)
Mime-Version: 1.0
X-Trace: fu-berlin.de 959104645 1268770 149.225.107.56 (16 [17104])
X-Posting-Agent: Hamster/1.3.13.0
User-Agent: Xnews/03.02.04
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp
Reply-To: djgpp AT delorie DOT com

Martin Stromberg wrote:

>So we should change ptrdiff_t to "signed long long int"?

I think, this wouldn't work. If you have

  ptrdiff_t pd;
  char *p1, *p2;
  ... 
  pd = p2 - p1;

The subtraction will be done in 32 bit arithmetic, which will incorrectly
wrap, when the difference is >= 2^31. This is a catch 22.

-- 
Regards, Dieter Buerssner
  
  

- Raw text -


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