This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
DEFAULT_MAIN_RETURN and C99...
- From: Zack Weinberg <zack at codesourcery dot com>
- To: gcc at gcc dot gnu dot org
- Date: Wed, 18 Jun 2003 13:29:13 -0700
- Subject: DEFAULT_MAIN_RETURN and C99...
Currently we have this logic in c-decl.c:finish_function:
#ifdef DEFAULT_MAIN_RETURN
/* Make it so that `main' always returns success by default.
*/
DEFAULT_MAIN_RETURN;
#else
if (flag_isoc99)
c_expand_return (integer_zero_node);
#endif
There are two definitions of DEFAULT_MAIN_RETURN in the source tree,
in i370/i370.h and s390/s390.h. Both definitions read
#define DEFAULT_MAIN_RETURN c_expand_return (integer_zero_node)
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.
Objections?
zw