Author Topic: gcc problem of PCLinuxOS 2010.7  (Read 283 times)

8086

  • Guest
gcc problem of PCLinuxOS 2010.7
« on: September 28, 2010, 11:16:03 PM »
I created a header file for a driver module:

#ifndef __CHR_DRV__
#define __CHR_DRV__

#include <linux/cdev.h>

#define DEVICE_NAME         "asic"
#define MODULE_NAME         "CHR_DRV"
#define XXX_DEV_MAJOR_NO      210

typedef struct _tagDRV_STRUCT
{
   int major_no;
   struct cdev dev;//incomplete type.
   char buffer[0x80];
}XXX_DEV;

extern XXX_DEV dev_info;

#endif

When compile this module, an error prompt: 'dev' has incomplete type.

I don't know why.  The 'struct cdev' is defined in 'linux/cdev.h' . I am using the system GCC and the system kernel headers. But when I compile this module in your another version PCLinuxOS 2007 TR3, it is OK! Is this version of GCC in PCLinuxOS 2010.7 has some problems?

8086

  • Guest
Re: gcc problem of PCLinuxOS 2010.7
« Reply #1 on: September 29, 2010, 03:34:55 AM »
The variable name is correct. If I use a pointer like 'struct cdev *dev', it's OK.