Next: , Previous: Objective-C and Objective-C++ Dialect Options, Up: Invoking GCC


3.7 Options to Control Diagnostic Messages Formatting

Traditionally, diagnostic messages have been formatted irrespective of the output device's aspect (e.g. its width, ...). The options described below can be used to control the diagnostic messages formatting algorithm, e.g. how many characters per line, how often source location information should be reported. Right now, only the C++ front end can honor these options. However it is expected, in the near future, that the remaining front ends would be able to digest them correctly.

-fmessage-length=n
Try to format error messages so that they fit on lines of about n characters. The default is 72 characters for g++ and 0 for the rest of the front ends supported by GCC. If n is zero, then no line-wrapping will be done; each error message will appear on a single line.


-fdiagnostics-show-location=once
Only meaningful in line-wrapping mode. Instructs the diagnostic messages reporter to emit once source location information; that is, in case the message is too long to fit on a single physical line and has to be wrapped, the source location won't be emitted (as prefix) again, over and over, in subsequent continuation lines. This is the default behavior.
-fdiagnostics-show-location=every-line
Only meaningful in line-wrapping mode. Instructs the diagnostic messages reporter to emit the same source location information (as prefix) for physical lines that result from the process of breaking a message which is too long to fit on a single line.
-fno-diagnostics-show-option
By default, each diagnostic emitted includes text which indicates the command line option that directly controls the diagnostic (if such an option is known to the diagnostic machinery). Specifying the -fno-diagnostics-show-option flag suppresses that behavior.
-Wcoverage-mismatch
Warn if feedback profiles do not match when using the -fprofile-use option. If a source file was changed between -fprofile-gen and -fprofile-use, the files with the profile feedback can fail to match the source file and GCC can not use the profile feedback information. By default, this warning is enabled and is treated as an error. -Wno-coverage-mismatch can be used to disable the warning or -Wno-error=coverage-mismatch can be used to disable the error. Disable the error for this warning can result in poorly optimized code, so disabling the error is useful only in the case of very minor changes such as bug fixes to an existing code-base. Completely disabling the warning is not recommended.