Email List: Xaustin-group-lX
[All Lists]

Re: Defect in XSH fgetwc

To: yyyyyyyyyyyyyy@xxxxxxxxxxxxx
Subject: Re: Defect in XSH fgetwc
From: Andrew Josey <yyyyyy@xxxxxxxxxxxxxxxxx>
Date: Wed, 12 Apr 2006 06:19:30 +0100
Organization: The Open Group
(another one from David Hopwood that the filters took a dislike too,
I'll whitelist David -- Andrew)

Geoff Clare wrote:
> @ page 378 line 12234 section fgetwc objection [gwc EILSEQ inconsistency]
> 
> Problem:
> 
> Defect code :  1. Error
> 
> There is some inconsistency between the EILSEQ errors for functions
> which convert wide characters to multibyte and vice versa.
> 
[...]
> I assume most of the functions have EILSEQ as "may fail" because on
> a system where MB_CUR_MAX is always 1 there would never be any invalid
> wide characters or multibyte sequences, and EILSEQ would never occur.
> So the changes I propose fix the inconsistency by making all the
> EILSEQ errors "may fail".  An alternative would be to make them all
> "shall fail" but with some contingency upon the existence of invalid
> wide characters or multibyte sequences.

I don't see why any such contingency would be needed. If a function
"shall fail if an invalid wide-character code is detected", and in a
particular implementation there are no invalid wide-character codes
and the error never occurs, then that part of the specification is
satisfied vacuously.

"May fail", OTOH, means something quite different: that the implementation
might or might not signal an error, perhaps at random or only on a full
moon, for each call where there is an invalid sequence.


<Prev in Thread] Current Thread [Next in Thread>
  • Re: Defect in XSH fgetwc, Andrew Josey <=