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

Defect in XSH iconv

To: yyyyyyyyyyyyyyy@xxxxxxxxxxxxx
Subject: Defect in XSH iconv
From: yyyyyyy@xxxxxxx
Date: Tue, 18 Feb 2003 16:30:05 GMT
        Defect report from : Joanna Farley , Sun Microsystems

(Please direct followup comments direct to yyyyyyyyyyyyyy@xxxxxxxxxxxxx)

@ page 587 line 19272 section iconv objection {sunw-jf03-ld4}

Problem:

Defect code :  1. Error

 There was a known descrepency in SUSv2 between the iconv.h header and the
interface page for iconv(). 
   
The interface page defined the second argument as const char ** while the
header page defined the second argument as char **. 
   
In interpretations on this it was noted as a Grey area in the Specification
and that the second argument is "const char **" and not "char **". 
   
See interpretation PIN5.009 
(http://www.opengroup.org/interps/xsh5/interps/pin/PIN5.009.html) 
See interpretation PIN4.029 
(http://www.opengroup.org/interps/vsx/interps/pin/PIN4.029.html) 
   
SUSv3 has been changed so that interface page was change to match the header 
page so the second argument is "char **".  
   
This is also mentioned in ERN report Austin/50r1 
(http://www.opengroup.org/austin/docs/austin_50r1.txt) where the change that
the header page should have been made to match the interface page and define
the second argument as "const char ** was rejected in Enhancement Request
Number 316 due to a Base Working group ruling (vwg/071/061994) 
   
Looking up vwg/071/061994 in the base resolution document 
http://www.opengroup.org/docsrv/TGbase/BaseFeb96/interps/VWG93-001.txt 
shows the folowing: 
   
   
         X/OPEN RESOLUTION: 
   
         The synopsis on the iconv() manual page is in error and the 
         synopsis on the <iconv.h> page is correct. 
   
         A future revision of XSH4 shall revise the prototype for 
         iconv() as follows: 
   
         Replace the argument type on the iconv() arguments in the 
         synopsis with that specified on the function prototype in 
         the <iconv.h> header. 
   
         For conformance to the current version of XSH4 either 
         prototype is allowed. 
   
         Test suite status: (iv) 

It is our belief that this resolution is in error and that as mentined in 
the above referenced interpretations the second argument is "const char **" 
and not "char **".

This argument is not modified by the iconv() interface and for consistancy 
with other interfaces in SUSv3 that do not modify an argument this should be
a const argument.

Action:

Change XSH6 page 587 line 19272 from:
size_t iconv(iconv_t cd, char **restrict inbuf,
to:
size_t iconv(iconv_t cd, const char **restrict inbuf,

and change XBD6 page 239 line 8386 from:
size_t  iconv(iconv_t, char **restrict, size_t *restrict,
to:
size_t  iconv(iconv_t, const char **restrict, size_t *restrict,

<Prev in Thread] Current Thread [Next in Thread>