From darrenr@FreeBSD.ORG  Thu Aug 21 11:29:11 2003
Return-Path: <darrenr@FreeBSD.ORG>
Received: by hub.freebsd.org (Postfix, from userid 680)
	id E059F16A4C0; Thu, 21 Aug 2003 11:29:11 -0700 (PDT)
Message-Id: <20030821182911.E059F16A4C0@hub.freebsd.org>
Date: Thu, 21 Aug 2003 11:29:11 -0700 (PDT)
From: Darren Reed <darrenr@FreeBSD.ORG>
Reply-To: Darren Reed <darrenr@FreeBSD.ORG>
To: FreeBSD-gnats-submit@freebsd.org
Cc:
Subject: <sys/systm.h> and <sys/types.h> conflict for major()
X-Send-Pr-Version: 3.113
X-GNATS-Notify:

>Number:         55846
>Category:       bin
>Synopsis:       <sys/systm.h> and <sys/types.h> conflict for major()
>Confidential:   no
>Severity:       serious
>Priority:       high
>Responsible:    freebsd-bugs
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Thu Aug 21 11:30:21 PDT 2003
>Closed-Date:    Wed Oct 05 06:16:27 GMT 2005
>Last-Modified:  Wed Oct 05 06:16:27 GMT 2005
>Originator:     Darren Reed
>Release:        FreeBSD 4.8-RC i386
>Organization:
FreeBSD
>Environment:
System: FreeBSD hub.freebsd.org 4.8-RC FreeBSD 4.8-RC #1: Sat Aug 16 06:09:47 PDT 2003 root@:/g/src/sys/compile/HUB i386


>Description:
Including <sys/types.h> and <sys/systm.h> for non-kernel compiles
causes the following problem:
/usr/include/sys/systm.h:346: syntax error before `int'
/usr/include/sys/systm.h:347: syntax error before `int'
/usr/include/sys/systm.h:348: syntax error before `('

These lines of code look like this after going through cpp:
int ((int)(((u_int)( dev_t x ) >> 8)&0xff)) ;
int ((int)(( dev_t x )&0xffff00ff)) ;
dev_t ((dev_t)((( int x ) << 8) | (  int y ))) ;

Problem is there is no #ifdef _KERNEL around the declarations for
these functions in <sys/systm.h>
>How-To-Repeat:
	
>Fix:

	


>Release-Note:
>Audit-Trail:

From: Bruce Evans <bde@zeta.org.au>
To: Darren Reed <darrenr@freebsd.org>
Cc: FreeBSD-gnats-submit@freebsd.org, freebsd-bugs@freebsd.org
Subject: Re: bin/55846: <sys/systm.h> and <sys/types.h> conflict for major()
Date: Fri, 22 Aug 2003 20:25:02 +1000 (EST)

 On Thu, 21 Aug 2003, Darren Reed wrote:
 
 > >Description:
 > Including <sys/types.h> and <sys/systm.h> for non-kernel compiles
 > causes the following problem:
 > /usr/include/sys/systm.h:346: syntax error before `int'
 > /usr/include/sys/systm.h:347: syntax error before `int'
 > /usr/include/sys/systm.h:348: syntax error before `('
 
 Don't do that then.  <sys/systm.h> is kernel-only.
 
 Bruce
State-Changed-From-To: open->closed 
State-Changed-By: rodrigc 
State-Changed-When: Wed Oct 5 06:15:50 GMT 2005 
State-Changed-Why:  
<sys/systm.h> is kernel-only. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=55846 
>Unformatted:
