Bug 55846

Summary: <sys/systm.h> and <sys/types.h> conflict for major()
Product: Base System Reporter: Darern Reed <darrenr>
Component: binAssignee: freebsd-bugs (Nobody) <bugs>
Status: Closed FIXED    
Severity: Affects Only Me    
Priority: Normal    
Version: Unspecified   
Hardware: Any   
OS: Any   

Description Darern Reed freebsd_committer freebsd_triage 2003-08-21 19:30:21 UTC
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>
Comment 1 Bruce Evans 2003-08-22 11:25:02 UTC
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
Comment 2 Craig Rodrigues freebsd_committer freebsd_triage 2005-10-05 07:15:50 UTC
State Changed
From-To: open->closed

<sys/systm.h> is kernel-only.