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]
Other format: [Raw text]

Re: [RFC] Deprecate "implicit int" for main() in C++


On 04/25/2018 04:40 PM, Jonathan Wakely wrote:
More concretely, deprecating it for a few releases would allow us to
apply the attached patch at some point in the future, so that instead
of:

rt.c:1:6: warning: ISO C++ forbids declaration of ‘main’ with no type [-Wreturn-type]
main() { return 0; }
      ^

We'd get:

rt.c:1:6: error: ISO C++ forbids declaration of 'main' with no type [-fpermissive]
main() { return 0; }
      ^

I wonder if it's currently a warning because the implicit int is used in configure checks. If this is the case, maybe we cannot make it an error without altering the result of configure tests?

Thanks,
Florian


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