This is the mail archive of the gcc-bugs@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]
Other format: [Raw text]

Re: c++/10569: use typedef type as return from main yields warning


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>


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