Bug 73819 - Compile error using module.h
Summary: Compile error using module.h
Keywords:
Status: CLOSED NOTABUG
Alias: None
Product: Red Hat Linux
Classification: Retired
Component: gcc
Version: 7.3
Hardware: i386
OS: Linux
medium
medium
Target Milestone: ---
Assignee: Jakub Jelinek
QA Contact: Brian Brock
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2002-09-11 15:01 UTC by nestor lacabe
Modified: 2007-04-18 16:46 UTC (History)
0 users

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2002-09-11 15:02:03 UTC
Embargoed:


Attachments (Terms of Use)

Description nestor lacabe 2002-09-11 15:01:57 UTC
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:
Always

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

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
{
...
      union
      {
            atomic_t usecount;
            long pad;
      } uc;
....

Comment 1 Jakub Jelinek 2002-09-11 15:06:58 UTC
/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 15:53:39 UTC
Thanks for your fast response, but the problem is the same with this path.

Comment 3 Jakub Jelinek 2002-09-11 15:56:04 UTC
Do you have kernel-source RPM installed (for the kernel you're running)?

Comment 4 nestor lacabe 2002-09-11 16:01:00 UTC
Yes, the source installation is very standard.


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