This pragma returns the severity of the diagnostic messages that have the specified tags to the severities that were in effect before any pragmas were issued.
// <stdio.h> not #included deliberately
#pragma diag_error 223
void hello(void)
{
printf("Hello ");
}
#pragma diag_default 223
void world(void)
{
printf("world!\n");
}
Compiling this code with the option --diag_warning=223 generates diagnostic messages to report that the function printf() is declared implicitly.
The effect of #pragma diag_default 223 is to return the severity of diagnostic message 223 to Warning severity, as specified by the --diag_warning command‑line option.