Bug 6559 - compiler problem in linux/input.h
Summary: compiler problem in linux/input.h
Status: REJECTED INVALID
Alias: None
Product: Drivers
Classification: Unclassified
Component: Input Devices (show other bugs)
Hardware: i386 Linux
: P2 low
Assignee: drivers_input-devices
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2006-05-15 12:36 UTC by Alexander Schmid
Modified: 2006-05-15 12:41 UTC (History)
1 user (show)

See Also:
Kernel Version: 2.6.16.14 (probably all 2.6.16.x, possibly even older kernels)
Subsystem:
Regression: ---
Bisected commit-id:


Attachments

Description Alexander Schmid 2006-05-15 12:36:24 UTC
Most recent kernel where this bug did not occur: 2.4.31 (I only tried 2.6.16.11,
2.6.16.14 and 2.4.31)
Distribution: Slackware 10.2 (with 2.4.31), but the 2.6.16.x are mainline
kernels from kernel.org
Hardware Environment:
Software Environment:

Problem Description:
Compilation of programs #including linux/input.h fails (gcc version 3.3.6):
In file included from test.c:2:
/usr/include/linux/input.h:801: error: syntax error before "kernel_ulong_t"
/usr/include/linux/input.h:805: error: syntax error before "evbit"
/usr/include/linux/input.h:805: error: `BITS_PER_LONG' undeclared here (not in a
function)
/usr/include/linux/input.h:806: error: syntax error before "keybit"
/usr/include/linux/input.h:806: error: `BITS_PER_LONG' undeclared here (not in a
function)
(...)
/usr/include/linux/input.h:815: error: syntax error before "driver_info"
/usr/include/linux/input.h:805: error: storage size of `evbit' isn't known
/usr/include/linux/input.h:806: error: storage size of `keybit' isn't known
/usr/include/linux/input.h:807: error: storage size of `relbit' isn't known
(...)

Steps to reproduce:
Just try to compile this:
-------------------------
#include <stdio.h>
#include <linux/input.h>

int main(int argc, char **argv) {
  printf("OK\n");
  return 0;
}
-------------------------

http://lists.altlinux.org/pipermail/sisyphus/2006-April/080482.html suggests
that this is because of using BITS_PER_LONG outside kernel space.
Their patch to linux/input.h solved the problem for me.

I ran into this when some packages of X.Org 7.0 failed to build (xorg-server,
among others).

Alex
Comment 1 Nishanth Aravamudan 2006-05-15 12:41:21 UTC
Don't include kernel headers in userspace.
Bug rejected.
Thanks,
Nish

Note You need to log in before you can comment on or make changes to this bug.