[Bug c/49182] Fordward declarations of struct not usable in function pointer types.
pinskia at gcc dot gnu.org
gcc-bugzilla@gcc.gnu.org
Thu May 26 23:45:00 GMT 2011
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49182
--- Comment #4 from Andrew Pinski <pinskia at gcc dot gnu.org> 2011-05-26 23:36:43 UTC ---
This works:
// Forward declaration
typedef struct _a a;
// Pointer to function with struct as parameter
typedef int (*FxnPointer)(a* WontComplie);
// Actual declaration of struct with function pointer type declared above.
struct _a
{
int foo;
int bar;
FxnPointer PtrToFxn;
};
int main(void)
{
a test_struct;
return 0;
}
More information about the Gcc-bugs
mailing list