Skip to contentSkip to conversation

Don't include <linux/compiler.h>

PATCH In review David Woodhouse 2 participants 3 messages Sep 11, 2006

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Don't include <linux/compiler.h>

This file is not one of the kernel headers which is exported to userspace by the kernel. It should not exist in /usr/include/linux and certainly shouldn't be included by userspace programs.

usb-linux.c +0 -1
diff -Naupr qemu-0.8.2.orig/usb-linux.c qemu-0.8.2/usb-linux.c
@@ -26,7 +26,6 @@
 #if defined(__linux__)
 #include <dirent.h>
 #include <sys/ioctl.h>
-#include <linux/compiler.h>
 #include <linux/usbdevice_fs.h>
 #include <linux/version.h>
 
Signature · 1 line
dwmw2
#1 lore raw

The problem is that without this header it does not compile on some distributions (see old mailing list messages).

Fabrice.

Quoted 16 lines · David Woodhouse

This file is not one of the kernel headers which is exported to userspace by the kernel. It should not exist in /usr/include/linux and certainly shouldn't be included by userspace programs.

diff -Naupr qemu-0.8.2.orig/usb-linux.c qemu-0.8.2/usb-linux.c

usb-linux.c +0 -1
@@ -26,7 +26,6 @@
 #if defined(__linux__)
 #include <dirent.h>
 #include <sys/ioctl.h>
-#include <linux/compiler.h>
 #include <linux/usbdevice_fs.h>
 #include <linux/version.h>
 
#2 lore raw
Quoted 2 lines · Fabrice Bellard

The problem is that without this header it does not compile on some distributions (see old mailing list messages).

And the problem is that _with_ it, it doesn't compile with the proper exported kernel headers from current kernels -- where <linux/compiler.h> does not exist.

Signature · 1 line
dwmw2