From WikiChip
Difference between revisions of "c/stdnoreturn.h/noreturn"
m (Jon moved page Stdnoreturn.h/noreturn - C to c/stdnoreturn.h/noreturn) |
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 | + | 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 | + | 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 13:54, 23 November 2015
The noreturn macro, which is part of <stdnoreturn.h>, expands to the _Noreturn keyword.
Contents
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);
}