On Fri, Aug 29, 2008 at 11:10:18PM +0100, Phil Endecott wrote:
> Ville Syrjälä wrote:
>> Now that I look at the prototype it actually looks more fundementally
>> wrong.
>>
>> 'char *(*argv[])' == 'char **argv[]' which is to say an
>> array of pointers to pointers to char.
>>
>> AFAIK it should be 'char *(*argv)[]' ie. a pointer to an array of
>> pointers to char. gcc 4.1 doesn't like this form however.
>
> I've tried some trivial code and it seems happy; can you post an example 
> that fails?

Well, it doesn't really fail, but it does print a warning.
"warning: passing argument 1 of ‘test1’ from incompatible pointer type"

void test1(char *(*argv)[])
{
}
void test2(char *(*argv[]))
{
}
void test3(char ***argv)
{
}
int main(int argc, char *argv[])
{
 test1(&argv);
 test2(&argv);
 test3(&argv);
 return 0;
}

-- 
Ville Syrjälä
[EMAIL PROTECTED]
http://www.sci.fi/~syrjala/
_______________________________________________
directfb-dev mailing list
directfb-dev@directfb.org
http://mail.directfb.org/cgi-bin/mailman/listinfo/directfb-dev

Reply via email to