Anonymous | Login | 2023-12-06 14:06 UTC |
Main | My View | View Issues | Change Log | Docs |
Viewing Issue Simple Details [ Jump to Notes ] | [ Issue History ] [ Print ] | ||||||
ID | Category | Severity | Type | Date Submitted | Last Update | ||
0001219 | [1003.1(2008)/Issue 7] System Interfaces | Objection | Error | 2018-12-12 17:29 | 2022-08-05 09:16 | ||
Reporter | sebor | View Status | public | ||||
Assigned To | ajosey | ||||||
Priority | normal | Resolution | Accepted As Marked | ||||
Status | Applied | ||||||
Name | Martin Sebor | ||||||
Organization | |||||||
User Reference | |||||||
Section | snprintf | ||||||
Page Number | 906 | ||||||
Line Number | 30447 | ||||||
Interp Status | --- | ||||||
Final Accepted Text | See Note: 0005895. | ||||||
Summary | 0001219: snprintf reequirement to fail when n > INT_MAX conflicts with C | ||||||
Description |
The snprintf description states that: The functionality described on this reference page is aligned with the ISO C standard. Any conflict between the requirements described here and the ISO C standard is unintentional. This volume of POSIX.1-2008 defers to the ISO C standard. and The snprintf() function shall fail if: [CX][EOVERFLOW] The value of n is greater than {INT_MAX}. The requirement conflicts with C. C requires snprintf to succeed regardless of the value of n provided it outputs fewer than INT_MAX bytes. The POSIX requirement prevents implementations from conforming to the C requirement. For example, the following strictly conforming C snippet must not trigger the assertion: char d[1]; int n = snprintf (d, (size_t)INT_MAX + 1, ""); assert (n == 0); while in POSIX the assertion is required to fail. |
||||||
Desired Action | Remove the requirement for snprintf to fail when n > INT_MAX. Same for other variants of the function, such as vsnprintf. | ||||||
Tags | tc3-2008 | ||||||
Attached Files | |||||||
|
![]() |
|||||||
|
![]() |
|||
Date Modified | Username | Field | Change |
2018-12-12 17:29 | sebor | New Issue | |
2018-12-12 17:29 | sebor | Status | New => Under Review |
2018-12-12 17:29 | sebor | Assigned To | => ajosey |
2018-12-12 17:29 | sebor | Name | => Martin Sebor |
2018-12-12 17:29 | sebor | Section | => snprintf |
2018-12-12 17:29 | sebor | Page Number | => 906 |
2018-12-12 17:29 | sebor | Line Number | => 30447 |
2018-12-12 17:48 | sebor | Note Added: 0004182 | |
2018-12-12 20:29 | sebor | Note Added: 0004183 | |
2018-12-12 21:06 | eblake | Relationship added | related to 0000761 |
2022-07-18 15:49 | Don Cragun | Interp Status | => --- |
2022-07-18 15:49 | Don Cragun | Note Added: 0005895 | |
2022-07-18 15:49 | Don Cragun | Status | Under Review => Resolved |
2022-07-18 15:49 | Don Cragun | Resolution | Open => Accepted As Marked |
2022-07-18 15:51 | Don Cragun | Final Accepted Text | => See Note: 0005895. |
2022-07-18 15:51 | Don Cragun | Tag Attached: tc3-2008 | |
2022-08-05 09:16 | geoffclare | Status | Resolved => Applied |
Mantis 1.1.6[^] Copyright © 2000 - 2008 Mantis Group |