View Issue Details
| ID | Project | Category | View Status | Date Submitted | Last Update |
|---|---|---|---|---|---|
| 0000566 | 1003.1(2008)/Issue 7 | Base Definitions and Headers | public | 2012-05-18 16:13 | 2019-06-10 08:55 |
| Reporter | eblake | Assigned To | ajosey | ||
| Priority | normal | Severity | Editorial | Type | Error |
| Status | Closed | Resolution | Accepted As Marked | ||
| Name | Eric Blake | ||||
| Organization | Red Hat | ||||
| User Reference | ebb.unistd | ||||
| Section | <unistd.h> | ||||
| Page Number | 443 | ||||
| Line Number | 15037 | ||||
| Interp Status | --- | ||||
| Final Accepted Text | See 0000566:0001243 | ||||
| Summary | 0000566: unistd.h and inclusion of other headers | ||||
| Description | The standard states that <unistd.h> must define intptr_t as in <inttypes.h>, but in reality, <inttypes.h> defers to a mandatory inclusion of <stdint.h> before intptr_t is defined. Furthermore, the standard is silent on whether <unistd.h> may pollute the namespace with all other definitions from headers, where most other headers are careful to state that the implicit inclusion of other headers is permitted but not required. I found this issue when debugging a program that had been expecting <unistd.h> to provide uint32_t; it turns out that glibc 2.14 exposes all of <stdint.h> from <unistd.h>, but that glibc 2.11 did not; making it explicit that the standard permits both behaviors would make it clear that the bug was in the program for not explicitly including enough headers. | ||||
| Desired Action | At line 15037, change "intptr_t type as described in <inttypes.h>." to "intptr_t type as described in <stdint.h>." After line 15128, add a new paragraph: Inclusion of the <unistd.h> header may make visible all symbols from the headers <stddef.h>, <stdint.h>, <stdio.h>, and <sys/types.h>. | ||||
| Tags | tc2-2008 | ||||
|
|
There is no need to include <sys/types.h> in the list; every header can make visible all symbols from <sys/types.h> (because _t is a reserved suffix for all the headers). |
|
|
At line 15037, change "intptr_t type as described in <inttypes.h>." to "intptr_t type as described in <stdint.h>." After line 15128, add a new paragraph: Inclusion of the <unistd.h> header may make visible all symbols from the headers <stddef.h>, <stdint.h>, and <stdio.h>. |
| Date Modified | Username | Field | Change |
|---|---|---|---|
| 2012-05-18 16:13 | eblake | New Issue | |
| 2012-05-18 16:13 | eblake | Status | New => Under Review |
| 2012-05-18 16:13 | eblake | Assigned To | => ajosey |
| 2012-05-18 16:13 | eblake | Name | => Eric Blake |
| 2012-05-18 16:13 | eblake | Organization | => Red Hat |
| 2012-05-18 16:13 | eblake | User Reference | => ebb.unistd |
| 2012-05-18 16:13 | eblake | Section | => <unistd.h> |
| 2012-05-18 16:13 | eblake | Page Number | => 443 |
| 2012-05-18 16:13 | eblake | Line Number | => 15037 |
| 2012-05-18 16:13 | eblake | Interp Status | => --- |
| 2012-05-21 10:43 | geoffclare | Note Added: 0001241 | |
| 2012-05-31 15:16 | nick | Note Added: 0001243 | |
| 2012-05-31 15:16 | nick | Status | Under Review => Resolved |
| 2012-05-31 15:16 | nick | Resolution | Open => Accepted As Marked |
| 2012-05-31 15:17 | nick | Final Accepted Text | => See 0000566:0001243 |
| 2012-05-31 15:17 | nick | Tag Attached: tc2-2008 | |
| 2019-06-10 08:55 | agadmin | Status | Resolved => Closed |