Export (0) Print
Expand All
Expand Minimize

/WL (Enable One-Line Diagnostics)

/WL

Error and warning messages from the C++ compiler can be followed by additional information that appears, by default, on a new line. When you compile from the command line, the additional line of information can be appended to the error or warning message. This might be desirable if you capture your build output to a log file and then process that log to find all errors and warnings. A semicolon will separate the error or warning message from the additional line.

Not all error and warning messages have an additional line of information. The following code will generate an error (C2440) that has an additional line of information; it will let you test the effect when you use /WL.

void func1()
{
   int *p;
   char *q;
   p = q;      // Conversion error
}
main(){
}

To set this compiler option in the Visual Studio development environment

  1. Open the project's Property Pages dialog box. For details, see Setting Visual C++ Project Properties.
  2. Click the C/C++ folder.
  3. Click the Command Line property page.
  4. Type the compiler option in the Additional Options box.

To set this compiler option programmatically

See AdditionalOptions.

See Also

Compiler Options | Setting Compiler Options

Show:
© 2014 Microsoft