NetBSD-Bugs archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
kern/46557: sys/syslog.h can't be compiled on its own with -D_KERNEL
>Number: 46557
>Category: kern
>Synopsis: sys/syslog.h can't be compiled on its own with -D_KERNEL
>Confidential: no
>Severity: non-critical
>Priority: low
>Responsible: kern-bug-people
>State: open
>Class: sw-bug
>Submitter-Id: net
>Arrival-Date: Wed Jun 06 20:15:00 +0000 2012
>Originator: Richard Hansen
>Release: 6.0_BETA
>Organization:
>Environment:
NetBSD <host> 6.0_BETA NetBSD 6.0_BETA (GENERIC) <stuff> amd64
>Description:
(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
In file included from test.c:1:0:
./sys/syslog.h: In function 'log':
./sys/syslog.h:241:34: error: expected declaration specifiers before
'__printflike'
./sys/syslog.h:242:30: error: expected declaration specifiers or '...' before
'__va_list'
./sys/syslog.h:242:41: error: expected '=', ',', ';', 'asm' or '__attribute__'
before '__printflike'
./sys/syslog.h:243:32: error: expected '=', ',', ';', 'asm' or '__attribute__'
before '__printflike'
./sys/syslog.h:241:6: error: old-style parameter declarations in prototyped
function definition
./sys/syslog.h:241:1: error: parameter name omitted
./sys/syslog.h:241:1: error: parameter name omitted
test.c:1:0: error: expected '{' at end of input
>Fix:
diff --git a/src/sys/sys/syslog.h b/src/sys/sys/syslog.h
index 410ad72..60753c4 100644
--- a/src/sys/sys/syslog.h
+++ b/src/sys/sys/syslog.h
@@ -34,6 +34,10 @@
#ifndef _SYS_SYSLOG_H_
#define _SYS_SYSLOG_H_
+#include <sys/cdefs.h> /* for __printflike() */
+#include <sys/featuretest.h>
+#include <sys/ansi.h> /* for __va_list */
+
#define _PATH_LOG "/var/run/log"
/*
@@ -206,10 +210,6 @@ struct syslog_data {
.log_mask = 0xff, \
}
-#include <sys/cdefs.h>
-#include <sys/featuretest.h>
-#include <sys/ansi.h>
-
__BEGIN_DECLS
void closelog(void);
void openlog(const char *, int, int);
Home |
Main Index |
Thread Index |
Old Index