Table of Contents
show
The error directive causes the preprocessor to generate customized diagnostic messages and causes the compilation to fail.
The error directive has the following forms,
#error
This directive causes the preprocessor to issue an error without any message.
#error token
This directive causes the preprocessor to issue an error message that indicates the text specified by the token sequence
Example
#include<stdio.h>
#error this is a customized error message
int main()
{
printf("use of error directive");
return 0;
}
Output
error.c:2:2: error: #error this is a customized error message
#error this is a customized error message
Views: 0