Bug 73819 - Compile error using module.h
Compile error using module.h
Product: Red Hat Linux
Classification: Retired
Component: gcc (Show other bugs)
i386 Linux
medium Severity medium
: ---
: ---
Assigned To: Jakub Jelinek
Brian Brock
Depends On:
  Show dependency treegraph
Reported: 2002-09-11 11:01 EDT by nestor lacabe
Modified: 2007-04-18 12:46 EDT (History)
0 users

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2002-09-11 11:02:03 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)

  None (edit)
Description nestor lacabe 2002-09-11 11:01:57 EDT
From Bugzilla Helper:
User-Agent: Mozilla/4.0 (compatible; MSIE 5.0; Windows 95; DigExt)

Description of problem:
Compile fail in an example kernel module.
From Alessandro Rubini's "Device Driver".
#define MODULE
#include <linux/module.h>
int init_module(void) { printk("<1>Hello, world\n"); return 0; }
void cleanup_module(void) { printk("<1>Goodbye cruel world\n"); }

Version-Release number of selected component (if applicable):

How reproducible:

Steps to Reproduce:
1.write hello.c
2.send 'gcc -c hello.c'

Actual Results:  In file included from hello.c:3:
/usr/include/linux/module.h:60: parse error before 'atomic_t'
/usr/include/linux/module.h:60: warning: no semicolon at end of struct or union
.....  more error messages

Additional info:

from module.h:
...... definitions
struct module
            atomic_t usecount;
            long pad;
      } uc;
Comment 1 Jakub Jelinek 2002-09-11 11:06:58 EDT
/usr/include/linux/* and /usr/include/asm/* headers are solely for userland
usage, for building kernel modules you need -I/lib/modules/`uname -r`/build/include
Comment 2 nestor lacabe 2002-09-11 11:53:39 EDT
Thanks for your fast response, but the problem is the same with this path.
Comment 3 Jakub Jelinek 2002-09-11 11:56:04 EDT
Do you have kernel-source RPM installed (for the kernel you're running)?
Comment 4 nestor lacabe 2002-09-11 12:01:00 EDT
Yes, the source installation is very standard.

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