Using the GNU Compiler Collection (GCC): Language Independent Options

Next: Warning Options, Previous: Objective-C and Objective-C++ Dialect Options, Up: Invoking GCC [Contents][Index]

### 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, …). You can use the options described below to control the formatting algorithm for diagnostic messages, e.g. how many characters per line, how often source location information should be reported. Note that some language front ends may not honor these options.

`-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 is done; each error message appears on a single line.

`-fdiagnostics-show-location=once`

  Only meaningful in line-wrapping mode. Instructs the diagnostic messages reporter to emit source location information once; 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 indicating 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.

`-fno-diagnostics-show-caret`

  By default, each diagnostic emitted includes the original source line and a caret ’^’ indicating the column. This option suppresses this information.

Next: Warning Options, Previous: Objective-C and Objective-C++ Dialect Options, Up: Invoking GCC [Contents][Index]