468,513 Members | 1,873 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 468,513 developers. It's quick & easy.

how to remove warning: initialization from incompatible pointer type?

I compiles a program in SLOS, but there is a warning i donot know how
to remove?

here is the framework of the code:
typedef struct device_tree
{
......

union
{
INT8U (*byte)(UID id); //read a byte from a particular device
INT8U (*bit)(UID id); //read a bit from a particular device
INT8U (*block)(UID id, block_data_t *block_w); //read a block
from a particular device
INT8U (*blockext)(UID id, block_data_t *block_w, unsigned long
addr, unsigned long length);
// read a block from flash or cf card
} read;
} device_tree_t;

device_tree_t devices[] =
{
{
/* device driver for serial ports */
"SERIO",
DEVICE_SERIO,
serio_init,
serio_open,
serio_close,
{outbyte},
{inbyte}, //*************this is warning line
*************************
isdataready,
0
},

{
"\0",
0,
0,
0,
0,
{0},
{0},
0,
0
}
};

INT8U inbyte(UID id, block_data_t *block_w)
{
//do something
}

Jul 26 '06 #1
2 9360
wa*********@gmail.com wrote:
I compiles a program in SLOS, but there is a warning i donot know how
to remove?
You don't have to post three times!
here is the framework of the code:
typedef struct device_tree
{
......

union
{
INT8U (*byte)(UID id); //read a byte from a particular device
INT8U (*bit)(UID id); //read a bit from a particular device
INT8U (*block)(UID id, block_data_t *block_w); //read a block
from a particular device
INT8U (*blockext)(UID id, block_data_t *block_w, unsigned long
addr, unsigned long length);
// read a block from flash or cf card
} read;
} device_tree_t;

device_tree_t devices[] =
{
{
/* device driver for serial ports */
"SERIO",
DEVICE_SERIO,
serio_init,
serio_open,
serio_close,
{outbyte},
{inbyte}, //*************this is warning line
*************************
Where is inbyte declared?
isdataready,
INT8U inbyte(UID id, block_data_t *block_w)
{
//do something
}
This signature doesn't match the first item in the enum (the only one
you can initialise).

--
Ian Collins.
Jul 26 '06 #2
Ian Collins wrote:
wa*********@gmail.com wrote:
>>INT8U inbyte(UID id, block_data_t *block_w)
{
//do something
}

This signature doesn't match the first item in the enum (the only one
you can initialise).
Oops, that should read 'union' not enum.

--
Ian Collins.
Jul 26 '06 #3

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

10 posts views Thread by isxyos | last post: by
29 posts views Thread by junky_fellow | last post: by
8 posts views Thread by Michael | last post: by
92 posts views Thread by Heinrich Pumpernickel | last post: by
reply views Thread by NPC403 | last post: by
1 post views Thread by fmendoza | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.