[dvblast-devel] tiny bug on platform where char is unsigned

Marian Ďurkovič md at bts.sk
Mon Oct 19 15:34:58 CEST 2009


On Mon, Oct 19, 2009 at 01:54:45PM +0100, Andy Gatward wrote:
> On 19/10/2009 12:46, "Marian Ďurkovič" <md at bts.sk> wrote:
> 
> > Just a small change - I replaced (int)EOF with -1 according to manpage
> > (EOF is defined in different header and hence not supposed here)
> 
> The manpage is incorrect here and on some systems EOF isn't -1.  I would
> prefer to leave this as is (as I do actually have a system where EOF != -1).

I just found an explanation:

     The getopt() function was once specified to return EOF instead of -1. 
     This was changed by IEEE Std 1003.2-1992 (``POSIX.2'') to decouple
     getopt() from <stdio.h>.

Doh, it's 17 years since then...

   M.



More information about the dvblast-devel mailing list