https://gcc.gnu.org/bugzilla/show_bug.cgi?id=82323
Bug ID: 82323 Summary: circular ifunc attribute on a function definition silently accepted Product: gcc Version: 8.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: c Assignee: unassigned at gcc dot gnu.org Reporter: msebor at gcc dot gnu.org Target Milestone: --- While testing the implementation of the fix for bug 82301 (and bug 81854) I noticed that the ifunc attribute is silently accepted on the definition of a function, like below: $ cat t.c && gcc -S -Wall -Wextra -Werror t.c int __attribute__ ((ifunc ("foo"))) foo (void) { return 0; } The attribute specification on this function is invalid because a) it specifies the indirect function itself as its own resolver, and b) it specifies a resolver that doesn't return the expected type (a pointer to the indirect function). It seems to me that the ifunc attribute should be rejected with an error on definitions of functions.