On Fri, Jun 08, 2001 at 03:02:56PM +0200, Assar Westerlund wrote:
> Peter Pentchev <[EMAIL PROTECTED]> writes:
> > GCC complains when I try to initialize the structure with something like:
> > 
> > struct validation_fun       val_init[] = {
> >     {"init",        valfun_init,    0}
> > };
> > 
> > This can be avoided by:
> > 
> > struct validation_fun       val_init[] = {
> >     {(char *) (uintptr_t) "init",   valfun_init,    0}
> > };
> > 
> > ..but as a matter of fact, static, pre-initialized valfun structs are
> > the rule rather than the exception in this program, so having this
> > syntax for all of them seems.. well.. ugly :)
> 
> What version of gcc is this?  2.96?
> 
> All versions of 2.95.x that I've tried seems to eat the following
> program with:
> 
> gcc -O -g -Werror -Wcast-qual -c foo.c
> 
> /assar
> 
> struct validation_fun {
>     const char      *name;
>     void            *fun;
>     int             dyn;
> };
> 
> struct validation_fun   val_init[] = {
>         {"init",        0,    0}
> };

My explanation was a reply to a suggestion to remove the 'const' in
the structure definition.

G'luck,
Peter

-- 
If I had finished this sentence,

To Unsubscribe: send mail to [EMAIL PROTECTED]
with "unsubscribe freebsd-hackers" in the body of the message

Reply via email to