From: "Kaveh R. Ghazi" <ghazi@caip.rutgers.edu>
To: egcs@cygnus.com
Subject: prototyping functions returning an enum, before the enum is defined
Date: Sun, 28 Jun 1998 12:37:00 -0000 [thread overview]
Message-ID: <199806281937.PAA00634@caip.rutgers.edu> (raw)
Some config/*/*.c files have extern functions returning an
enum of some sort. Eg, function_arg_padding() in sparc.c which
returns an `enum direction'. I'd like to be able to prototype these
in sparc.h, but we don't have the definition of `enum direction' from
expr.h yet.
Is it legal in both KNR and ANSI C to say:
> extern enum direction function_arg_padding();
before `enum direction' has been defined?
What about doing:
> enum direction;
> extern enum direction function_arg_padding();
I'd like to please hear if either of these would be correct.
Thanks,
--Kaveh
PS: This was handled in rs6000.[ch] by making function_arg_padding()
return an int and having that int cast to an `enum direction' in the
proper place. I'd prefer to not have to use that solution if possible.
--
Kaveh R. Ghazi Project Manager / Custom Development
ghazi@caip.rutgers.edu Icon CMT Corp.
next reply other threads:[~1998-06-28 12:37 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
1998-06-28 12:37 Kaveh R. Ghazi [this message]
1998-06-29 3:22 ` Andreas Schwab
1998-06-29 20:41 Michael Meissner
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=199806281937.PAA00634@caip.rutgers.edu \
--to=ghazi@caip.rutgers.edu \
--cc=egcs@cygnus.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).