Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > C Programming > how to remove warning: initialization from incompatible pointer type?

Reply
Thread Tools

how to remove warning: initialization from incompatible pointer type?

 
 
wanglei0214@gmail.com
Guest
Posts: n/a
 
      07-26-2006
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
}

 
Reply With Quote
 
 
 
 
Andrew Poelstra
Guest
Posts: n/a
 
      07-26-2006
On 2006-07-26, http://www.velocityreviews.com/forums/(E-Mail Removed) <(E-Mail Removed)> 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.
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Re: How include a large array? Edward A. Falk C Programming 1 04-04-2013 08:07 PM
Proper Initialization of Pointer to Pointer bwaichu@yahoo.com C Programming 11 02-09-2008 05:33 PM
how to remove warning: initialization from incompatible pointer type? wanglei0214@gmail.com C Programming 2 07-26-2006 08:13 AM
how to remove warning: initialization from incompatible pointer type? wanglei0214@gmail.com C Programming 0 07-26-2006 07:51 AM
initialization from incompatible pointer type Brian Stubblefield C Programming 3 05-27-2004 01:31 PM



Advertisments