"lock.c", line 12: warning
+wperfadvice
This option enables performance advisory messages. It offers both
Example
$ cat large.c struct X{
int i;
int arr[1000]; } x;
int foo( struct X); int main() {
foo (x);
}
$ cc
"large.c", line 8: warning
advice: passing a
large (4004 bytes) parameter by value is inefficient, consider passing
by reference foo (x);
^
+w
Enable all warnings about potentially questionable constructs in the compiler. This includes warnings such as +wlint and +w64bit warnings. The number of warnings with this option may be up to
•Variable is declared but never referenced
•Comparison of unsigned integer with signed integer
•Padding size of structure to alignment boundary
•Argument is incompatible with corresponding format string conversion
+Oinfo
This option displays informational messages about the optimization process. It may be helpful in understanding what optimizations are occurring. These messages are not emitted with the +w option.
+Oinitcheck
This option enables warnings about local variables that may be used before they are defined. Many of the warnings generated with this option may be false positives.
Security Diagnostics
+wsecurity
This option enables compile time diagnostics for potential security vulnerabilities. Security flaws are not only very costly to fix, but also can lead to a potential loss of customers and reputation. Most developers are not trained to detect security vulnerabilities.
With the +wsecurity option, warnings are emitted for scenarios where untrusted (tainted) data may reach a critical reference point in the program. This is based on
5