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: Zack Weinberg <zack at codesourcery dot com>
- To: Roger Sayle <roger at eyesopen dot com>
- Cc: gcc-patches at gcc dot gnu dot org, ghazi at caip dot rutgers dot edu
- Date: Thu, 4 Jul 2002 09:03:40 -0700
- Subject: Re: [PATCH] Overhaul builtin function attributes
- References: <Pine.LNX.4.33.0207040630210.23928-100000@www.eyesopen.com>
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