This is the mail archive of the gcc-patches@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: [PATCH] Overhaul builtin function attributes


On Thu, Jul 04, 2002 at 07:11:43AM -0600, Roger Sayle wrote:
> 
> Thanks to the recent builtin_function API change, we can now
> simplify the way that attributes are specified for C-family
> builtin functions.  The trick is to use builtin-attrs.def
> the same way as we use builtin-types.def, i.e. as a way of
> associating an enumerated type with a tree that can be used
> by builtins.def.

This looks like a good deal.  Just one question:

> + /* 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.

zw


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