-w
Pragma equivalent
None.
Purpose
Suppresses warning messages.
Defaults
All informational and warning messages are reported.
Usage
Informational and warning messages that supply additional information to a severe error are not disabled by this option.
Predefined macros
None.
Examples
Consider the file myprogram.C.
//The content of file myprogram.C
#include <stdio.h>
int main()
{ char* greet = "hello world";
printf("%d \n", greet);
return 0;
}
- If you compile myprogram.C without
the -w option, the compiler issues a warning message.
Output:xlC myprogram.C
"5:18: warning: format specifies type 'int' but the argument has type 'char *' [-Wformat] printf("%d \n", greet); ~~ ^~~~~ %s 1 warning generated."
- If you compile myprogram.C with the -w option,
the warning message is suppressed.
xlC myprogram.C -w