On Fri, Apr 15, 2005 at 10:36:52AM +0200, Michael Stefaniuc wrote:
Christopher Li wrote:
while trying to run sparse on the Wine sources I got a segfault which can be reproduced with following code:
int (*oink)() = (void *)0;
Well, it is a lazy fix. I am not sure about that is the best fix.
I think "p" the place holder for return idents, which is the ident of the symbol get created.
int a;
eventually (*p) will set to a point of ident which is "a". There is code set p to NULL when after a grouping, e.g. "(a)" so after ")" there is no more ident expect from the group.
Thanks for the explanation.
Yeah, it works now. But there is one thing that feels strange:the p for parameter_type_list is just for print out warning. But the ident can still be NULL. e.g.
void foo(void(*)(void));
so if you want to see the symbol name that is causing the warning, I have the following patch will show the "oink" instead of "<noident>" in the warning.
Why is the declaration of the function pointer with empty parameter list a correct ANSI function declaration
int (*oink)();
but the initialization of the same function pointer is not?
int (*oink)() = NULL;
bye
michael
--
Michael Stefaniuc Tel.: +49-711-96437-199
System Administration Fax.: +49-711-96437-111
Red Hat GmbH Email: [EMAIL PROTECTED]
Hauptstaetterstr. 58 http://www.redhat.de/
D-70178 Stuttgart
-
To unsubscribe from this list: send the line "unsubscribe linux-sparse" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at http://vger.kernel.org/majordomo-info.html
