View Issue Details
| ID | Project | Category | View Status | Date Submitted | Last Update |
|---|---|---|---|---|---|
| 0000105 | 1003.1(2008)/Issue 7 | System Interfaces | public | 2009-06-30 19:14 | 2013-04-16 13:06 |
| Reporter | geoffclare | Assigned To | ajosey | ||
| Priority | normal | Severity | Objection | Type | Error |
| Status | Closed | Resolution | Accepted | ||
| Name | Geoff Clare | ||||
| Organization | The Open Group | ||||
| User Reference | |||||
| Section | strtod | ||||
| Page Number | 2036 | ||||
| Line Number | 64500 | ||||
| Interp Status | |||||
| Final Accepted Text | |||||
| Summary | 0000105: errno change on success | ||||
| Description | _____________________________________________________________________________ OBJECTION Enhancement Request Number 34 gwc:xxxxxxxxxxxxx Defect in XSH strtod (rdvk# 1) [gwc errno change on success] Mon, 27 Apr 2009 12:33:07 +0100 _____________________________________________________________________________ C99 says (7.5 paragraph 3) "The value of errno may be set to nonzero by a library function call whether or not there is an error, provided the use of errno is not documented in the description of the function in this International Standard." This implies that for all functions in C99 where the description documents the use of errno, the function can only set errno as per the description - it cannot change errno on success (unless its description says it can). For some of these functions, POSIX has CX shading on the statement that the function does not change errno on success. This text should not have CX shading. Affected functions are: strtod(), strtof(), strtold(), strtol(), strtoll(), strtoul(), strtoull(), wcstod(), wcstof(), wcstold(), wcstol(), wcstoll(), wcstoul(), wcstoull(). There are also some functions for which POSIX omits a statement that it does not change errno on success. Affected functions are: fgetpos(), fsetpos(), ftell(), fgetwc(), fputwc(), signal(), mbrlen(), mbrtowc(), wcrtomb(), mbsrtowcs(), wcsrtombs(). (Note that, by a strict reading of C99, all the byte I/O and wide I/O functions are also affected. However, this matter has been raised with the C committee and it appears likely that a change will be made in C1x. Therefore I have not included changes for those functions.) | ||||
| Desired Action | Remove the CX shading from "The strtod() function shall not change the setting of errno if successful. Since 0 is returned on error and is also a valid return on success, an application wishing to check for error situations should set errno to 0, then call strtod(), strtof(), or strtold(), then check errno." and remove the CX shading from similar text at page 2044 line 64780 section strtol page 2049 line 64884 section strtoul page 2224 line 69996 section wcstod page 2231 line 70204 section wcstol page 2238 line 70365 section wcstoul (In each case it is the entire CX shaded block that should be unshaded.) Also for strtod(), strtol(), strtoul(), wcstod(), and wcstoul() change the first sentence of the affected text to match wcstol(): "These functions shall not change the setting of errno if successful." At page 850 line 28241 section fgetpos page 854 line 28343 section fgetwc page 910 line 30406 section fputwc page 940 line 31503 section fsetpos page 1272 line 41808 section mbrlen page 1274 line 41871 section mbrtowc page 1277 line 41989 section mbsrtowcs page 1937 line 61644 section signal page 2195 line 69168 section wcrtomb page 2219 line 69823 section wcsrtombs add a new paragraph (substituting the relevant function name for "funcname") at the end of the DESCRIPTION: "The funcname() function shall not change the setting of errno if successful. At page 956 line 32041 section ftell change "[CX]The ftello() function shall be equivalent to ftell(), except that the return value is of type off_t.[/CX]" to "The ftell() function shall not change the setting of errno if successful. [CX]The ftello() function shall be equivalent to ftell(), except that the return value is of type off_t and the ftello() function may change the setting of errno if successful.[/CX]" | ||||
| Tags | c99, tc1-2008 | ||||
| Date Modified | Username | Field | Change |
|---|---|---|---|
| 2009-06-30 19:14 | msbrown | New Issue | |
| 2009-06-30 19:14 | msbrown | Status | New => Under Review |
| 2009-06-30 19:14 | msbrown | Assigned To | => ajosey |
| 2009-06-30 19:14 | msbrown | Name | => Mark Brown |
| 2009-06-30 19:14 | msbrown | Organization | => IBM |
| 2009-06-30 19:14 | msbrown | Section | => strtod |
| 2009-06-30 19:14 | msbrown | Page Number | => 2036 |
| 2009-06-30 19:14 | msbrown | Line Number | => 64500 |
| 2009-06-30 19:14 | msbrown | Status | Under Review => Resolved |
| 2009-06-30 19:14 | msbrown | Resolution | Open => Accepted |
| 2009-07-01 16:13 |
|
Name | Mark Brown => Geoff Clare |
| 2009-07-01 16:13 |
|
Organization | IBM => T |
| 2009-07-01 16:13 |
|
Reporter | msbrown => geoffclare |
| 2009-07-01 16:14 |
|
Organization | T => The Open Group |
| 2009-08-06 16:17 | nick | Tag Attached: c99 | |
| 2010-08-27 13:19 | ajosey | Tag Attached: tc1-2008 | |
| 2013-04-16 13:06 | ajosey | Status | Resolved => Closed |