Hi All,
*************** *************** *************** ****
error: variable `hdlc_cdevsw' has initializer but incomplete type
*************** *************** *************** ******
This is the error that i'm getting while trying to compiling a driver
..inspite of this way of declaration being valid in gcc i'm getting this
error.
I have declared hdlc_open and defined CDEV_MAJOR prior to this .
static struct cdevsw hdlc_cdevsw = {
.d_name = "hdlc_cdev" ,
.d_maj = CDEV_MAJOR,
.d_open = hdlc_open;
};
I'm here by providing the cdevsw structure for ur refrence .kindly let me
know why this err is occuring .
Charac device structure
struct cdevsw {
int d_version;
int d_maj;
u_int d_flags;
const char *d_name;
d_open_t *d_open;
d_fdopen_t *d_fdopen;
d_close_t *d_close;
d_read_t *d_read;
d_write_t *d_write;
d_ioctl_t *d_ioctl;
d_poll_t *d_poll;
d_mmap_t *d_mmap;
d_strategy_t *d_strategy;
dumper_t *d_dump;
d_kqfilter_t *d_kqfilter;
d_spare1_t *d_spare1;
d_spare2_t *d_spare2;
/* These fields should not be messed with by drivers */
LIST_ENTRY(cdev sw) d_list;
LIST_HEAD(, cdev) d_devs;
int d_refcount;
};
kindly let me know what is the problem here
Thanks in Advance ,
RAshmi.N.S 2 2092
"rashmi" <ns******@gmail .com> wrote in message
news:6d******** *************** *******@localho st.talkaboutpro gramming.com... Hi All, *************** *************** *************** **** error: variable `hdlc_cdevsw' has initializer but incomplete type *************** *************** *************** ******
This is the error that i'm getting while trying to compiling a driver .inspite of this way of declaration being valid in gcc i'm getting this error. I have declared hdlc_open and defined CDEV_MAJOR prior to this . static struct cdevsw hdlc_cdevsw = { .d_name = "hdlc_cdev" ,
^^^ dots aren't part of the name, they have special use -- when accessing
member of a structure but not when defining/declaring it. Remove the dots
here.
Alex
On Tue, 20 Sep 2005 17:29:22 +0400, Alexei A. Frounze wrote: "rashmi" <ns******@gmail .com> wrote in message news:6d******** *************** *******@localho st.talkaboutpro gramming.com... Hi All, *************** *************** *************** **** error: variable `hdlc_cdevsw' has initializer but incomplete type *************** *************** *************** ******
This is the error that i'm getting while trying to compiling a driver .inspite of this way of declaration being valid in gcc i'm getting this error. I have declared hdlc_open and defined CDEV_MAJOR prior to this .
The error is saying that the structure type is incomplete i.e. the
compiler cannot see a definition (i.e. the specification of the
structure members) of struct cdevsw at this point.
static struct cdevsw hdlc_cdevsw = { .d_name = "hdlc_cdev" ,
^^^ dots aren't part of the name, they have special use -- when accessing member of a structure but not when defining/declaring it. Remove the dots here.
Dots aren't part of the name but they are part of the C99 named structure
member initialisation syntax so they are required here.
Lawrence This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics |
by: Thomas Matthews |
last post by:
Hi,
Given a structure of pointers:
struct Example_Struct
{
unsigned char * ptr_buffer;
unsigned int * ptr_numbers;
};
And a function that will accept the structure:
|
by: Norm Wong |
last post by:
If anyone is interested in using db2uext2 with Cygwin gcc compiler on
Windows, I've modified the IBM provided sample with the attached file.
There are two main modifications.
The mkdir command is the POSIX compliant version as opposed to the
MicroSoft C compiler. The second parameter to mkdir is the file mode.
In this case, I've made the directories created to be
read/write/execute(list) for all users.
|
by: Mannequin* |
last post by:
Hi all,
I'm working on a quick program to bring the Bible into memory from a
text file. Anyway, I have three questions to ask.
First, is my implementation of malloc () correct in the program to
follow?
Second, have I correctly passed the structure's pointer to the
functions in this program?
|
by: Kirt Loki Dankmyer |
last post by:
So, I download the latest "stable" tar for perl (5.8.7) and try to compile
it on the Solaris 8 (SPARC) box that I administrate. I try all sorts of
different switches, but I can't get it to compile. I need it to be
compiled with threads.
Anyone have any wisdom on how best to do this?
Here's a transcript of my latest attempt. It's long; you might want to
skip to the bottom, where I try "make" and the fatal errors start
happening.
|
by: Calle Pettersson |
last post by:
Coming from writing mostly in Java, I have trouble understanding how to
declare a member without initializing it, and do that later... In Java,
I would write something like
public static void main(String args) {
MyType aMember;
...
aMember = new MyType(...)
...
}
However, in C++ this does not seem to work. I declare in class (it's
| |
by: WebSnozz |
last post by:
I have an application written in C that does a lot of low level stuff.
It does a lot of things like casting from void*'s. I want to create a
new GUI for it in either C# or MC++, but reuse the existing code.
The options I've considered so far:
1. Create a new MC++ GUI project and add the *.c files to them and mark
them with pragma unamanged. However, the /clr option does not compile
*.c files, so I rename them to *.cpp, and now they...
|
by: Mik0b0 |
last post by:
Hallo.
Let's say, there is a structure
struct struct10{
int a1;
int a2;
int a3;
int a4;
}count={
{10,20,30,40},
{50,60,70,80}
|
by: WaterWalk |
last post by:
Hello. When I consult the ISO C++ standard, I notice that in
paragraph 3.6.2.1, the standard states:
"Objects with static storage duration shall be zero-initialized before
any other initialization takes place."
Does this mean all non-local objects will be zero-initialized before
they are initialized by their initializers(if they have)? For example:
int g_var = 3;
int main() {}
|
by: jbholman |
last post by:
I am pretty new to C and doing my first project in C. I actually read
almost the entire FAQ, but can't seem to figure out this problem.
I have a structure. I have a list of these structures. Inside each
structure, I have two members: a list of strings, and a string.
I have made a sample program below that exhibits the error I am
having. I also read about Valgrind, and used it to tell me where I
was getting the segmentation fault,...
|
by: marktang |
last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look !
Part I. Meaning of...
|
by: Hystou |
last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it.
First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
| |
by: jinu1996 |
last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth.
The Art of Business Website Design
Your website is...
|
by: tracyyun |
last post by:
Dear forum friends,
With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
|
by: isladogs |
last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM).
In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules.
He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms.
Adolph will...
|
by: conductexam |
last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one.
At the time of converting from word file to html my equations which are in the word document file was convert into image.
Globals.ThisAddIn.Application.ActiveDocument.Select();...
|
by: 6302768590 |
last post by:
Hai team
i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
|
by: muto222 |
last post by:
How can i add a mobile payment intergratation into php mysql website.
| |
by: bsmnconsultancy |
last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...
| |