<html><head></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><div>I updated the -fdiagnostics-format implementation based on the feedback, and added a test case. When adding support for columns for msvc I ran into the issue that -fshow-column was not supported, as implied by the documentation, so I had to also fix that in the patch. I added -fshow-column to the test case, since it was obviously missing.</div><div><br></div><div>The default behavior for -fms-extensions folks is the same as before.</div><div><br></div><div><dt id="opt_fdiagnostics-show-category" style="color: rgb(34, 34, 34); font-family: 'Lucida Grande', 'Lucida Sans Unicode', Arial, Verdana, Helvetica, sans-serif; line-height: 19px; font-size: small; "><b>-fdiagnostics-format=clang/msvc/vi</b>: Changes diagnostic output format to better match IDEs and command line tools.</dt><dd style="color: rgb(34, 34, 34); font-family: 'Lucida Grande', 'Lucida Sans Unicode', Arial, Verdana, Helvetica, sans-serif; line-height: 19px; font-size: small; ">This option controls the output format of the filename, line number, and column printed in diagnostic messages. The default for this option is clang. If ifms-extensions is set then the default is changed to msvc and -fno-show-column is also set.<p>For example, a format string warning will produce these three renditions based on the setting of this option, the fourth rendition shows default output when -fms-extensions is set:</p><pre> t.c:3:11: warning: conversion specifies type 'char *' but the argument has type 'int'</pre><pre> t.c(3,11) : warning: conversion specifies type 'char *' but the argument has type 'int' </pre><pre> t.c +3:11: warning: conversion specifies type 'char *' but the argument has type 'int' </pre><div><pre> t.c(3) : warning: conversion specifies type 'char *' but the argument has type 'int' </pre></div><div><br></div></dd></div><div><br></div><div>In this code from ParseDiagnosticArgs():</div><div><br></div><div><div> if (Args.hasArg(OPT_fms_extensions)) {</div><div> Opts.Format = DiagnosticOptions::Msvc;</div><div> Opts.ShowColumn = Args.hasArg(OPT_fshow_column);</div><div> } else </div><div> Opts.Format = DiagnosticOptions::Clang;</div></div><div><br></div><div>The call to Args.hasArg(OPT_fshow_column) always seems to return 0? Does this mean I did not add -fshow-column correctly?</div><div><br></div><div>This works as expected:</div><div><div>>/Users/fish/work/Clang2/build/Release/bin/clang -fsyntax-only -ccc-host-triple x86_64-pc-win32 diag-format.c </div><div>diag-format.c(28) : warning: extra tokens at end of #endif directive [-Wextra-tokens]</div><div>#endif bad // extension!</div><div> ^</div><div> //</div><div>1 warning generated.</div></div><div><br></div><div>This works:</div><div><div>>/Users/fish/work/Clang2/build/Release/bin/clang -fsyntax-only -fdiagnostics-format=msvc -ccc-host-triple x86_64-pc-win32 diag-format.c </div><div>diag-format.c(28,7) : warning: extra tokens at end of #endif directive [-Wextra-tokens]</div><div>#endif bad // extension!</div><div> ^</div><div> //</div><div>1 warning generated.</div></div><div><br></div><div>This one does not:</div><div><div>>/Users/fish/work/Clang2/build/Release/bin/clang -fsyntax-only -ccc-host-triple x86_64-pc-win32 -fshow-column diag-format.c </div><div>diag-format.c(28) : warning: extra tokens at end of #endif directive [-Wextra-tokens]</div><div>#endif bad // extension!</div><div> ^</div><div> //</div><div>1 warning generated.</div></div><div><br></div><div>So what am I missing?</div><br><div>
<div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; font-size: 12px; "><div>Andrew Fish</div><div><br></div><div></div></div></div></body></html>