This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

prototyping functions returning an enum, before the enum is defined


	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.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]