T
Tatu Portin
I have a struct:
typedef struct {
char **user_comments;
int *comment_wds;
int comments;
char *vendor;
} vorbis_comment;
void func (char **table)
{
return;
}
int main (void)
{
vorbis_comment vc;
/* This part GCC doesn't like */
func (vc.user_comments);
return 0;
}
GCC (3.1) would say that
>warning: passing arg 1 of 'func' from incompatible pointer type
But still my code in 'func' (not posted, above is an example) works correctly,
utilizing whole '**table'.
Now what I want to ask is that which is the legal way to make a call of this
kind? Or is it just a bug or "feature" of GCC?
I am compiling with a commandline:
gcc -Wall -pedantic -ansi -mcpu=athlon -ffast-math -O2
typedef struct {
char **user_comments;
int *comment_wds;
int comments;
char *vendor;
} vorbis_comment;
void func (char **table)
{
return;
}
int main (void)
{
vorbis_comment vc;
/* This part GCC doesn't like */
func (vc.user_comments);
return 0;
}
GCC (3.1) would say that
>warning: passing arg 1 of 'func' from incompatible pointer type
But still my code in 'func' (not posted, above is an example) works correctly,
utilizing whole '**table'.
Now what I want to ask is that which is the legal way to make a call of this
kind? Or is it just a bug or "feature" of GCC?
I am compiling with a commandline:
gcc -Wall -pedantic -ansi -mcpu=athlon -ffast-math -O2