| Summary: | sys/socket.h uses u_char without including sys/types.h | ||
|---|---|---|---|
| Product: | Base System | Reporter: | peter <peter> |
| Component: | misc | Assignee: | freebsd-bugs (Nobody) <bugs> |
| Status: | Closed FIXED | ||
| Severity: | Affects Only Me | ||
| Priority: | Normal | ||
| Version: | 4.2-STABLE | ||
| Hardware: | Any | ||
| OS: | Any | ||
State Changed From-To: open->closed This is documented in the manpages. Take for example socket(2), it lists <sys/types.h> before <sys/socket.h>. The order of includes should follow the manpage. |
sys/socket.h contains, amongst others, the line: typedef u_char sa_family_t; u_char is defined in sys/types.h, but sys/socket.h doesn't include it Fix: Include sys/types.h from sys/socket.h How-To-Repeat: #include <sys/socket.h> #include <sys/types.h> void main(void) { } Swapping the two include lines around makes it compile fine.