This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH] Overhaul builtin function attributes
- From: Roger Sayle <roger at eyesopen dot com>
- To: Zack Weinberg <zack at codesourcery dot com>
- Cc: <gcc-patches at gcc dot gnu dot org>
- Date: Thu, 4 Jul 2002 11:14:44 -0600 (MDT)
- Subject: Re: [PATCH] Overhaul builtin function attributes
> > + /* Declare abort, exit, _exit and _Exit */
> > + DEF_BUILTIN (BUILT_IN_ABORT,
> > + "__builtin_abort",
> > + NOT_BUILT_IN,
> > + (c_language == clk_cplusplus ? BT_FN_VOID : BT_FN_VOID_VAR),
> > + (c_language == clk_cplusplus ? BT_FN_VOID : BT_FN_VOID_VAR),
> > + 1, 0, 0,
> > + ATTR_NORETURN_NOTHROW_LIST)
> > +
> > + DEF_BUILTIN (BUILT_IN_EXIT,
> > + "__builtin_exit",
> > + NOT_BUILT_IN,
> > + (c_language == clk_cplusplus ? BT_FN_VOID_INT : BT_FN_VOID_VAR),
> > + (c_language == clk_cplusplus ? BT_FN_VOID_INT : BT_FN_VOID_VAR),
> > + 1, 0, 0,
> > + ATTR_NORETURN_NOTHROW_LIST)
>
> I realize that you copied this logic from the old definitions, but is
> there any good reason to make the prototype conditional on the
> language? In both C89 and C++, these are correctly prototyped as
> void abort(void), void exit(int)... I suspect the (...) declarations
> are a hangover from K+R compat mode.
I'd be more than happy to fix this. Unfortunately, I've don't have
access to any of the relevant standards, so when in doubt I just
preserved the original semantics. Fixing this would certainly avoid
the "#define c_language 0" cruft that the patch had to add to the
java front-end.
Would anyone be unhappy with me making this suggested change in a
revised patch?
Roger
--