NetBSD-Bugs archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: kern/46557: sys/syslog.h can't be compiled on its own with -D_KERNEL



The following reply was made to PR kern/46557; it has been noted by GNATS.

From: David Holland <dholland-bugs%netbsd.org@localhost>
To: gnats-bugs%NetBSD.org@localhost
Cc: 
Subject: Re: kern/46557: sys/syslog.h can't be compiled on its own with
 -D_KERNEL
Date: Sun, 20 Jul 2014 23:08:16 +0000

 On Wed, Jun 06, 2012 at 08:15:00PM +0000, rhansen%bbn.com@localhost wrote:
  > (snapshot of netbsd-6 from 2012-03-28)
  > 
  > With -D_KERNEL, <sys/syslog.h> fails to compile unless <sys/cdefs.h> and 
<sys/ansi.h> are included before it.
  > >How-To-Repeat:
  > $ cd /usr/src/sys
  > $ echo '#include <sys/syslog.h>' >test.c
  > $ gcc -ffreestanding -nostdinc -D_KERNEL -I. -c test.c
 
 As per longstanding tradition, you need <sys/types.h> first in kernel
 source files.
 
 If you aren't compiling kernel code, don't use -D_KERNEL. What are you
 trying to do? You might be looking for -D_KMEMUSER.
 
 When these constraints are honored, it works for me...
 
 -- 
 David A. Holland
 dholland%netbsd.org@localhost
 


Home | Main Index | Thread Index | Old Index