Bug 15197

Summary: Bug in /usr/include/netinet/in.h with u_int32_t
Product: Base System Reporter: root <root>
Component: i386Assignee: freebsd-bugs (Nobody) <bugs>
Status: Closed FIXED    
Severity: Affects Only Me    
Priority: Normal    
Version: 3.3-STABLE   
Hardware: Any   
OS: Any   
Attachments:
Description Flags
file.diff none

Description root 1999-12-01 03:30:01 UTC
There is a definition in /usr/include/netinet/in.h,
$FreeBSD: src/sys/netinet/in.h,v 1.38.2.3 1999/08/29 16:29:34 peter Exp $,
line 223:

struct in_addr {
	u_int32_t s_addr;
};

<netinet/in.h> does not define u_int32_t. It does not include <sys/types.h>
or something else that defines u_int32_t. Therefore, if a C-program
includes <netinet/in.h> and <sys/types.h> AFTER, it fails to compile.
I discovered it compiling Perl module TacacsPlus-0.16 fetched from CPAN.

Fix: Here is a patch:
How-To-Repeat: 
Download http://www.perl.com/CPAN-local/authors/id/MSHOYHER/TacacsPlus-0.16.tar.gz
tar xfvz TacacsPlus-0.16.tar.gz
perl Makefile.PL
make
   
Here you will have parse error in /usr/include/netinet/in.h
Comment 1 Sheldon Hearn 1999-12-01 12:33:59 UTC
On Wed, 01 Dec 1999 10:28:10 +0700, root@pal.svznov.kemerovo.su wrote:

> <netinet/in.h> does not define u_int32_t. It does not include <sys/types.h>
> or something else that defines u_int32_t. Therefore, if a C-program
> includes <netinet/in.h> and <sys/types.h> AFTER, it fails to compile.

You're right.  That's why you _always_ include <sys/*> before the rest
of your headers.  This is standard practice.

If you find any FreeBSD manual pages in which the SYNOPSIS shows the
inclusion of <sys/*> _after_ the inclusion of other headers, please
report such documentation bugs in a new PR.

You should contact the maintainers of the code that's breaking for you
and get them to order their inclusions correctly.

I'd close your problem report, but can't access the database at the
moment.  Hopefully someone else will do the honours.

Ciao,
Sheldon.
Comment 2 Sheldon Hearn freebsd_committer freebsd_triage 1999-12-01 13:42:26 UTC
State Changed
From-To: open->closed

Bug in 3rd-party source, see follow-up for details.