Velocity Reviews

Velocity Reviews (http://www.velocityreviews.com/forums/index.php)
-   C Programming (http://www.velocityreviews.com/forums/f42-c-programming.html)
-   -   how to remove warning: initialization from incompatible pointer type? (http://www.velocityreviews.com/forums/t443691-how-to-remove-warning-initialization-from-incompatible-pointer-type.html)

wanglei0214@gmail.com 07-26-2006 07:51 AM

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
}


Andrew Poelstra 07-26-2006 04:56 PM

Re: how to remove warning: initialization from incompatible pointer type?
 
On 2006-07-26, wanglei0214@gmail.com <wanglei0214@gmail.com> wrote:
> I compiles a program in SLOS, but there is a warning i donot know how
> to remove?
>


1) Don't post three times. You've lost a lot of potential help
doing that.
2) What warning do you get? Don't assume that everyone has the
subject of the message right beside them. I'd post it for
everyone else, but I've already snipped the code.
3) It shouldn't really matter what compiler you're using, as
long as you are using it in full standards mode will the
maximum warning levels set.

(To fix the warning "initialization from incompatible pointer type"
you should probably stop initializing pointers from incompatible
types. I can't imagine how doing that could go right for someone
who doesn't even know what the error means.)

--
Andrew Poelstra <website down>
My server is down; you can't mail
me, nor can I post convieniently.


All times are GMT. The time now is 08:00 AM.

Powered by vBulletin®. Copyright ©2000 - 2013, vBulletin Solutions, Inc.
SEO by vBSEO ©2010, Crawlability, Inc.