This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
Re: c++/10569: use typedef type as return from main yields warning
- From: Geoff Keating <geoffk at geoffk dot org>
- To: bangerth at dealii dot org
- Cc: gcc-bugs at gcc dot gnu dot org, gcc-prs at gcc dot gnu dot org, nobody at gcc dot gnu dot org, wxy at kivera dot com, gcc-gnats at gcc dot gnu dot org
- Date: 30 Apr 2003 12:16:42 -0700
- Subject: Re: c++/10569: use typedef type as return from main yields warning
- References: <20030430180219.6494.qmail@sources.redhat.com>
bangerth@dealii.org writes:
> An implementation shall not predefine the main function. This func-
> tion shall not be overloaded. It shall have a return type of type
> int,...
> I can't say whether this rules out having a typedef to
> int instead. I think the answer is: don't do it, there's
> no good reason for such bogosity.
The standard does permit this. Typedefs are just names for existing
types, not new types, and so can be used anywhere that the type could
be used.
--
- Geoffrey Keating <geoffk@geoffk.org>