Movatterモバイル変換


[0]ホーム

URL:


cppreference.com
Namespaces
Variants
    Actions

      C attribute: noreturn, _Noreturn(since C23)

      From cppreference.com
      <c‎ |language‎ |attributes
       
       
       
       
      Attributes
      noreturn_Noreturn
      (C23)(C23)(deprecated)
       

      Indicates that the function does not return.

      Contents

      [edit]Syntax

      [[noreturn]]
      [[__noreturn__]]
      [[_Noreturn]]
      [[___Noreturn__]]
      (deprecated)

      [edit]Explanation

      Indicates that the function does not return.

      This attribute applies to the name of the function and specifies that the function does not return by executing the return statement or by reaching the end of the function body (it may return by executinglongjmp). The behavior is undefined if the function with this attribute actually returns. A compiler diagnostic is recommended if this can be detected.

      It has been previously denoted by the keyword_Noreturn until it was deprecated since C23 and replaced by this attribute.

      [edit]Standard library

      The following standard functions are declared withnoreturn attribute (they used to be declared with_Noreturn specifier until C23):

      [edit]See also

      C documentation for_Noreturn
      C++ documentation for[[noreturn]]
      Retrieved from "https://en.cppreference.com/mwiki/index.php?title=c/language/attributes/noreturn&oldid=145161"

      [8]ページ先頭

      ©2009-2025 Movatter.jp