_Noreturn The function specifier tells the compiler that the function will not return anything. If some return statements are used inside the program, the compiler will generate a compile-time error.
#include<stdio.h> main() { printf("The returned value: %d</p><p>", function); } char function() { return 'T'; //return T as character }
The program terminates abnormally [Warning] function declared 'noreturn' has a 'return' statement
Now if it is a normal function it will work fine.
#include<stdio.h> int function() { return 86; //try to return a value } main() { printf("The returned value: %d</p><p>", function()); }
The returned value: 86
The above is the detailed content of In C language, _Noreturn function specifier. For more information, please follow other related articles on the PHP Chinese website!