From peter@dataloss.net  Tue Jan 30 15:26:39 2001
Return-Path: <peter@dataloss.net>
Received: from dataloss.net (massive.dataloss.net [212.189.232.193])
	by hub.freebsd.org (Postfix) with SMTP id AE18737B6D6
	for <FreeBSD-gnats-submit@freebsd.org>; Tue, 30 Jan 2001 15:26:32 -0800 (PST)
Received: (qmail 7240 invoked by uid 1000); 30 Jan 2001 23:19:42 -0000
Message-Id: <20010130231942.7239.qmail@massive.dataloss.net>
Date: 30 Jan 2001 23:19:42 -0000
From: peter@dataloss.net
Reply-To: peter@dataloss.net
To: FreeBSD-gnats-submit@freebsd.org
Subject: sys/socket.h depends on sys/types.h without including it
X-Send-Pr-Version: 3.2

>Number:         24744
>Category:       misc
>Synopsis:       sys/socket.h uses u_char without including sys/types.h
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-bugs
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Tue Jan 30 15:30:01 PST 2001
>Closed-Date:    Fri Jun 29 16:10:14 PDT 2001
>Last-Modified:  Fri Jun 29 16:11:51 PDT 2001
>Originator:     Peter van Dijk
>Release:        FreeBSD 4.2-STABLE i386
>Organization:
-
>Environment:

RELENG_4, cvsupped and world'ed dec 16th 2000.

>Description:

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

>How-To-Repeat:

#include <sys/socket.h>
#include <sys/types.h>

void main(void)
{
}


Swapping the two include lines around makes it compile fine.

>Fix:

Include sys/types.h from sys/socket.h

>Release-Note:
>Audit-Trail:
State-Changed-From-To: open->closed 
State-Changed-By: mikeh 
State-Changed-When: Fri Jun 29 16:10:14 PDT 2001 
State-Changed-Why:  
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. 

http://www.FreeBSD.org/cgi/query-pr.cgi?pr=24744 
>Unformatted:
