delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp-workers/1998/01/27/09:00:26

Sender: vheyndri AT rug DOT ac DOT be
Message-Id: <34CDE851.1153@rug.ac.be>
Date: Tue, 27 Jan 1998 14:59:45 +0100
From: Vik Heyndrickx <Vik DOT Heyndrickx AT rug DOT ac DOT be>
Mime-Version: 1.0
To: Eli Zaretskii <eliz AT is DOT elta DOT co DOT il>
Cc: DJ Delorie <dj AT delorie DOT com>, djgpp-workers AT delorie DOT com
Subject: Re: iostream concern
References: <Pine DOT SUN DOT 3 DOT 91 DOT 980127145642 DOT 843G-100000 AT is>

Eli Zaretskii wrote:
> 
> On Mon, 26 Jan 1998, DJ Delorie wrote:
> 
> > Beware: in MS-DOS the file position may be negative.  At least, this
> > is what I remember from our discussion of the portability of lseek()
> > under "undefined" conditions.  Having a file position that doesn't
> > allow for negative numbers, when MS-DOS will gladly give you a
> > negative number, may cause obscure problems at runtime.
> 
> This means that our `fsetpos' and `fgetpos' are broken also, since
> fpos_t is unsigned.

IIRC the standard tells that the only parameter to fsetpos should be the
result of a fgetpos. The returned value has no meaning to the user, so
it will be never used in offset calculations ;-) So these functions may
be broken, but nothing bad could happen (as long as the user sticks to
standard use).

-- 
 \ Vik /-_-_-_-_-_-_/   
  \___/ Heyndrickx /          
   \ /-_-_-_-_-_-_/

- Raw text -


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