I would argue that it's less than "perfectly" legal: The C standard lists it as a "common extension":
J.5.7 Function pointer casts A pointer to an object or to void may be cast to a pointer to a function, allowing data to be invoked as a function
I would argue that it's less than "perfectly" legal: The C standard lists it as a "common extension":
And on a practical level, it seems to me that the increasing proliferation of NX enforcement is cramping the acceptance of this extension.