* warning: initialization discards qualifiers from pointer target type
@ 2008-03-03 20:40 Andre Kirchner
2008-03-03 21:40 ` John Love-Jensen
0 siblings, 1 reply; 2+ messages in thread
From: Andre Kirchner @ 2008-03-03 20:40 UTC (permalink / raw)
To: gcc-help
Hi All,
When I compile the following piece of code, I get 3 "warning: initialization discards qualifiers from pointer target type" messages which refer to the 3 lines marked in the code. What's wrong with these lines? I searched the web for it, but didn't find anything useful.
Thanks,
Andre
enum CompressionType {
DEFLATE = 0,
GZIP
};
struct CompressionInfo {
char * Name;
int32_t Type;
uint32_t WindowSize;
};
static struct CompressionInfo compression_table[] = {
{ "deflate", DEFLATE, DEFLATE_WINDOW_SIZE }, <-- HERE
{ "gzip", GZIP, 24 }, <-- HERE
{ "", -1, 0 } <-- HERE
};
____________________________________________________________________________________
Never miss a thing. Make Yahoo your home page.
http://www.yahoo.com/r/hs
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: warning: initialization discards qualifiers from pointer target type
2008-03-03 20:40 warning: initialization discards qualifiers from pointer target type Andre Kirchner
@ 2008-03-03 21:40 ` John Love-Jensen
0 siblings, 0 replies; 2+ messages in thread
From: John Love-Jensen @ 2008-03-03 21:40 UTC (permalink / raw)
To: Andre Kirchner, GCC-help
Hi Andre,
Change your struct so you can refer to string constants:
struct CompressionInfo {
char const * Name;
int32_t Type;
uint32_t WindowSize;
};
HTH,
--Eljay
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2008-03-03 21:40 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-03-03 20:40 warning: initialization discards qualifiers from pointer target type Andre Kirchner
2008-03-03 21:40 ` John Love-Jensen
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).