Function typedefs have any use?

Gabriel Dos Reis
Sun Feb 6 18:42:00 GMT 2005

"Kevin P. Fleming" <> writes:

| Eljay Love-Jensen wrote:
| > But the syntax of C doesn't have the language construct of "here's a
| > label (identifier), here's the type of that label, and here's it's
| > body".
| Yeah, that's what I figured.
| > So, no, you'll have to do it "the hard way".
| Agreed. Seems like a rather illogical oversight to be able to able to
| define a "type" for a function but not actually be able to declare
| functions of that "type" (except as pointers to them), but that's
| we've got.

You mean like this:

      typedef int F(int);
      F f;      /* function "f" taking an int and returning an int. */


-- Gaby

More information about the Gcc-help mailing list