View Issue Details
| ID | Project | Category | View Status | Date Submitted | Last Update |
|---|---|---|---|---|---|
| 0002015 | 1003.1(2024)/Issue8 | System Interfaces | public | 2026-11-29 17:18 | 2026-11-29 17:18 |
| Reporter | romanzilka | Assigned To | |||
| Priority | normal | Severity | Comment | Type | Clarification Requested |
| Status | New | Resolution | Open | ||
| Name | Roman Žilka | ||||
| Organization | |||||
| User Reference | |||||
| Section | strerror | ||||
| Page Number | 0 | ||||
| Line Number | 0 | ||||
| Interp Status | |||||
| Final Accepted Text | |||||
| Summary | 0002015: strerror*(): Inconsistencies re. behavior on error | ||||
| Description | The section on strerror*() says: "If the value of errnum is a valid error number, the message string shall indicate what error occurred; if the value of errnum is zero, the message string shall either be an empty string or indicate that no error occurred; otherwise, if these functions complete successfully, the message string shall indicate that an unknown error occurred." It should be made clear that strerror() does return strings in said format, but isn't one of "these functions", because "strerror() shall map any value of type int to a message" and "whether successful or not, strerror() shall return a pointer to the generated message string". The sentence (quoted in full) is the only place in the whole Description which deals with the specific contents of the returned string, so it's tempting to try and fit strerror() into that (whole) sentence. As for strerror_l(), "if these functions complete successfully, the message string shall indicate that an unknown error occurred", so when EINVAL is the outcome, it may not have returned a valid string. But later: "If errnum is not a valid error number, errno may be set to [EINVAL], but a pointer to a message string shall still be returned". It's hard to tell which of these two behaviors is intended. Elsewhere: "strerror_l() is required to return a string for some errors" may again be wrong, see above. strerror_r() seems clear: in the EINVAL situation, a non-zero may or may not be returned, but when it isn't, a string was returned. In Rationale, this sentence provides no new information or advice: "Since no return value is reserved to indicate a strerror() error, but all calls (whether successful or not) must return a pointer to a message string, on error strerror() can return a pointer to an empty string or a pointer to a meaningful string that can be printed." | ||||
| Desired Action | I can formulate a proposal after clarification. | ||||
| Tags | No tags attached. | ||||
| Date Modified | Username | Field | Change |
|---|---|---|---|
| 2026-11-29 17:18 | romanzilka | New Issue |