4 ms·
So how do I declare a function pointer for a function that takes two arguments and returns a value, all of which are function pointers of that same type?
by burfog 8y ago
So how do I declare a function pointer for a function that takes two arguments and returns a value, all of which are function pointers of that same type?
- mehrdadn 8y agoI can't tell if this is a rhetorical question or not, but you can't have recursive typedefs in C.
- burfog 8y agoI can't tell either. :-) The grammar seems to prevent recursive typedefs, but I've never seen it spelled out that you can't have them. This has caused me trouble on occasion. I can't even seem to solve this with gcc's non-standard __typeof__ extension. I was halfway expecting to crash or hang the compiler.
- mehrdadn 8y agoI mean if you take the grammar to be part of the official language specification and you believe it prohibits recursive typedefs then isn't that sufficient? It seems a bit like saying it causes you trouble on occasion that they never explicitly spelled out that 'deftype' isn't a synonym for 'typedef'? I would've assumed that if something is not valid in the grammar then it's not valid in the language described by it.
- burfog 8y agoWell the hope is that somehow I'm misunderstanding the grammar... because there simply must be a way to do this. How can the language committee leave this flaw unfixed?
- mehrdadn 8y ago> there simply must be a way to do this. Why? This seems completely baseless. > How can the language committee leave this flaw unfixed? Same way many languages like C++, C#, Java, VB etc. left this "flaw" unfixed.
- toast0 8y agovoid* </s>