bug-gnulib
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH] test-raise: use _Noreturn


From: Paolo Bonzini
Subject: Re: [PATCH] test-raise: use _Noreturn
Date: Fri, 07 Oct 2011 10:02:11 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:6.0.2) Gecko/20110906 Thunderbird/6.0.2

On 10/06/2011 10:43 AM, Bruno Haible wrote:
> Bernhard Voelker wrote:
>> Alternatively, can't we use _exit() here?
> 
> This would not change the problem: _exit() is, like exit(), declared
> as nonreturning on glibc systems and not declared this way on some
> other platforms.

Is this true?  exit is declared as a nonreturning built-in by GCC
(devel/gcc/gcc/builtins.def):

DEF_LIB_BUILTIN        (BUILT_IN_EXIT, "exit", BT_FN_VOID_INT,
 ATTR_NORETURN_NOTHROW_LIST)

It has been so since 2002 (r55276) for C++, and "forever" for C.  The
code that was first checked into RCS already had this:

      /* Declare these functions volatile
         to avoid spurious "control drops through" warnings.  */
      /* Don't specify the argument types, to avoid errors
         from certain code which isn't valid in ANSI but which exists.  */
      temp = builtin_function ("abort",
                               build_function_type (void_type_node, 0),
                               NOT_BUILT_IN, 0);
      TREE_THIS_VOLATILE (temp) = 1;
      TREE_SIDE_EFFECTS (temp) = 1;
#if 0
      /* Suppress error if redefined as a non-function.  */
      DECL_BUILT_IN_NONANSI (temp) = 1;
#endif
      exit_type = build_function_type (void_type_node, 0);
      temp = builtin_function ("exit", exit_type, NOT_BUILT_IN, 0);
      TREE_THIS_VOLATILE (temp) = 1;
      TREE_SIDE_EFFECTS (temp) = 1;
#if 0
      /* Suppress error if redefined as a non-function.  */
      DECL_BUILT_IN_NONANSI (temp) = 1;
#endif

For non-GCC compilers I don't think we care about warnings, do we?

Paolo




reply via email to

[Prev in Thread] Current Thread [Next in Thread]