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: DEFAULT_MAIN_RETURN and C99...


On Wed, 18 Jun 2003, Zack Weinberg wrote:

> I see no reason not to make this behavior unconditional and
> target-independent.  In other words, for main, always call
> c_expand_return (integer_zero_node) at this point.  This will suppress
> the "control reaches end of non-void function" warning, but we could
> fix that with a little cleverness.

As I noted <http://gcc.gnu.org/ml/gcc-patches/2000-07/msg01009.html>,
users will expect that diagnostic in C90 mode, so we should ensure that we
keep it (and test for that: we already test that C99 mode does not yield
the warning).  As VAX/VMS support has gone away, the other definition of
DEFAULT_MAIN_RETURN mentioned in that message is now irrelevant.

Logically, when we have a -Wc90 or similar option (analogous to
-Wtraditional, warn for differences between C90 and C99, including the
various warnings done if (pedantic && !flag_isoc99)) the warning should
also apply for -Wreturn-type -Wc90 (in C99 mode as well as in C90 mode).

-- 
Joseph S. Myers
jsm28@cam.ac.uk


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