-w
Pragma equivalent
None.
Purpose
Suppresses warning messages.
This option is equivalent to specifying -qflag=e : e.
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.
#include <stdio.h>
int main()
{ char* greeting = "hello world";
printf("%d \n", greeting);
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", greeting); ~~ ^~~~~ %s 1 warning generated."
- If you compile myprogram.c with the -w option,
the warning message is suppressed.
xlC myprogram.c -w