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

Defect in XSH ctime()

To: yyyyyyyyyyyyyyy@xxxxxxxxxxxxx
Subject: Defect in XSH ctime()
From: yyyyyyyyyyyyyyy@xxxxxxx
Date: Fri, 12 Dec 2003 01:36:00 GMT
        Defect report from : Robbin Kawabata , Sun Microsystems, Inc.

(Please direct followup comments direct to yyyyyyyyyyyyyy@xxxxxxxxxxxxx)

@ page 243 line 8051-8053 section ctime() objection {rrk031211-1}

Problem:

Edition of Specification (Year): 2003

Defect code :  1. Error

A TC2 (XSH/TC2/D5/17 [XSH ERN 115]) change to asctime() allows a 
NULL return if asctime() is unsuccessful.  The ctime() specification 
should also be changed to return NULL if unsuccessful, because it 
is specified as being equivalent to:
         asctime(localtime(time))

If asctime() can return NULL, then ctime() can too.

Also, the input value of clock can be outside the range that can 
be represented in a struct tm.  In such a case, ctime() should 
also return NULL.


Action:

page 243 line 8051-8053 section ctime() objection
  Change:
     The ctime() function shall convert the time pointed to by  clock,
     representing  the  time in seconds since the Epoch, to local time
     in the form  of  a  string.  It shall be equivalent to:
          asctime(localtime(clock))
  to:

     The ctime() function shall convert the time pointed to by clock,
     representing  the  time in seconds since the Epoch, to local time
     in the form  of  a  string.  If clock can be successfully 
     represented in a struct tm, the ctime() function shall be 
     equivalent to:
          asctime(localtime(clock))

     If clock is outside the range of times that can be represented
     in a struct tm, the ctime() function shall return NULL.

page 243 line 8064-8065 section ctime() objection
  Change:
     The ctime() function shall return the pointer returned by asctime()
     with that broken-down time as an argument.
  to:

     On successful completion, the ctime() function shall return the pointer
     returned by asctime() with that broken-down time as an argument.  If the
     ctime() function is unsuccessful, it shall return NULL.

page 243 line 8069 section ctime() objection
   Change:
     No errors are defined.
   to:

     The ctime() and ctime_r() functions may fail if:

       [EOVERFLOW]  The result cannot be represented.

<Prev in Thread] Current Thread [Next in Thread>
  • Defect in XSH ctime(), robbin.kawabata <=