From WikiChip
Difference between revisions of "c/stdnoreturn.h/noreturn"
< c‎ | stdnoreturn.h

m
 
Line 1: Line 1:
 
{{DISPLAYTITLE: noreturn macro - <stdnoreturn.h> - C}}
 
{{DISPLAYTITLE: noreturn macro - <stdnoreturn.h> - C}}
 
{{Stdnoreturn.h - C}}
 
{{Stdnoreturn.h - C}}
The '''noreturn''' macro, which is part of [[stdnoreturn.h - C|<stdnoreturn.h>]], expands to the [[_Noreturn - C|_Noreturn]] [[Reserved keywords - C|keyword]].
+
The '''noreturn''' macro, which is part of {{c|stdnoreturn.h|<stdnoreturn.h>}}, expands to the {{c|_Noreturn}} {{c|keyword}}.
  
 
== Synopsis ==
 
== Synopsis ==
Line 10: Line 10:
  
 
== Description ==
 
== Description ==
The noreturn object-like macro expands to the [[_Noreturn - C|_Noreturn]], a keyword added in [[C11]] to mark non-returning functions.
+
The noreturn object-like macro expands to the {{c|_Noreturn}}, a keyword added in [[C11]] to mark non-returning functions.
  
 
== Example ==
 
== Example ==

Latest revision as of 14:54, 23 November 2015

The noreturn macro, which is part of <stdnoreturn.h>, expands to the _Noreturn keyword.

Synopsis[edit]

#include <stdnoreturn.h>
#define noreturn _Noreturn

Description[edit]

The noreturn object-like macro expands to the _Noreturn, a keyword added in C11 to mark non-returning functions.

Example[edit]

#include <stdlib.h>
#include <stdio.h>
#include <stdnoreturn.h>

noreturn void fatal()
{
    fprintf(stderr, "Program encountered an unrecoverable error\n");
    exit(EXIT_FAILURE);
}

See also[edit]