This is the mail archive of the
gcc-prs@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: nobody at gcc dot gnu dot org
- Cc: gcc-prs at gcc dot gnu dot org,
- Date: 30 Apr 2003 19:26:01 -0000
- Subject: Re: c++/10569: use typedef type as return from main yields warning
- Reply-to: Geoff Keating <geoffk at geoffk dot org>
The following reply was made to PR c++/10569; it has been noted by GNATS.
From: Geoff Keating <geoffk@geoffk.org>
To: bangerth@dealii.org
Cc: gcc-bugs@gcc.gnu.org, gcc-prs@gcc.gnu.org, nobody@gcc.gnu.org,
wxy@kivera.com, gcc-gnats@gcc.gnu.org
Subject: Re: c++/10569: use typedef type as return from main yields warning
Date: 30 Apr 2003 12:16:42 -0700
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>