<div dir="ltr"><div class="gmail_quote"><div dir="ltr">On Fri, Sep 4, 2015 at 6:00 PM Paul Hoad <<a href="mailto:mydeveloperday@gmail.com">mydeveloperday@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div>Manuel</div><div>     clang-check went nuts! so backed up a bit and used Reid suggestion</div><div><br></div><div>Reid</div><div>    this did better once I added a -D_M_X64 (after getting a #error unsupported architecture)</div><div><br></div><div></div></div><div dir="ltr"><div><div>clang-tidy Stdio.cxx -- -I"c:/Program Files (x86)/Microsoft Visual Studio 14.0/VC/INCLUDE" -I"c:/Program Files (x86)/Windows Kits/10/Include/10.0.10150.0/ucrt"</div></div></div><div dir="ltr"><div><div>-fms-extensions -fms-compatibility -fms-compatibility-version=19 -std=c++11 -D_MSC_VER=1900 -D_M_X64</div><div>64 warnings and 3 errors generated.</div></div></div><div dir="ltr"><div><div><br></div><div>Error while processing D:\buildareas\HEAD\issdev\src\test\tidy\Stdio.cxx.</div></div></div><div dir="ltr"><div><div>c:/Program Files (x86)/Microsoft Visual Studio 14.0/VC/INCLUDE\limits:1117:24: error: constexpr function never produces a constant expression [clang-diagnostic-</div><div>invalid-constexpr]</div><div>         static _CONST_FUN _Ty infinity() _THROW0()</div><div>                              ^</div><div>c:/Program Files (x86)/Microsoft Visual Studio 14.0/VC/INCLUDE\limits:1119:11: note: floating point arithmetic produces an infinity</div><div>                return (_INF_LIMIT);</div><div>                        ^</div><div>c:/Program Files (x86)/Microsoft Visual Studio 14.0/VC/INCLUDE\limits:52:21: note: expanded from macro '_INF_LIMIT'</div><div> #define _INF_LIMIT     INFINITY</div></div><div><br></div><div>as this was complaining about constexpr I dropped the -std=c++11 and this gave me an assertion.</div></div><div dir="ltr"><div><br></div><div>clang-tidy Stdio.cxx -- -I"c:/Program Files (x86)/Microsoft Visual Studio 14.0/VC/INCLUDE" -I"c:/Program Files (x86)/Windows Kits/10/Include/10.0.10150.0/ucrt"</div></div><div dir="ltr"><div>-fms-extensions -fms-compatibility -fms-compatibility-version=19 -D_MSC_VER=1900 -D_M_X64</div><div><br></div><div>Assertion failed: !isNull() && "Cannot retrieve a NULL type pointer", file D:\src\llvm_snapshot_244436\llvm\tools\clang\include\clang/AST/Type.h, line 585</div><div><br></div><div>So I backed up again</div><div><br></div><div><div>clang-tidy Stdio.cxx -- -I"c:/Program Files (x86)/Microsoft Visual Studio 12.0/VC/INCLUDE" -fms-extensions -fms-compatibility -fms-compatibility-version=18 -std=c++11 -D_MSC_VER=1800 -D_M_X64</div></div><div><br></div><div>This time dropping back to VS2013 and adding your c++11 back in...perfect that worked...</div><div><br></div><div><div>clang-tidy Stdio.cxx -- -I"c:/Program Files (x86)/Microsoft Visual Studio 12.0/VC/INCLUDE" -fms-extensions -fms-compatibility -fms-compatibility-version=18 -std=c++11 -D_M_X64</div><div>18 warnings generated.</div><div>Suppressed 18 warnings (18 in non-user code).</div><div>Use -header-filter=.* to display errors from all non-system headers.</div></div><div><br></div><div>I wonder if I should log a bug to this effect that clang-tidy isn't working with VS2015 headers?</div></div></blockquote><div><br></div><div>This still looks like compiler warnings. You need to be able to compile the code (with clang) before running clang-tidy on it.</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div><br></div><div><br></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Fri, Sep 4, 2015 at 4:26 PM, Reid Kleckner <span dir="ltr"><<a href="mailto:rnk@google.com" target="_blank">rnk@google.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">This looks like clang-tidy doesn't know it's targeting Windows and doesn't know that C++11 is enabled.<div><br></div><div>Try throwing "-fms-extensions -fms-compatibility -fms-compatibility-version=19 -std=c++11" on the command line and see what happens?</div></div><div class="gmail_extra"><br><div class="gmail_quote"><div><div>On Fri, Sep 4, 2015 at 4:28 AM, Paul Hoad via cfe-dev <span dir="ltr"><<a href="mailto:cfe-dev@lists.llvm.org" target="_blank">cfe-dev@lists.llvm.org</a>></span> wrote:<br></div></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div><div><div dir="ltr">Sorry sorry in advance if this is a newbie question, I'm trying to get clang-tidy (3.8.0 trunk) working on Windows pointing at the with the Visual Studio 2015 headers (VC and UCRT)<div><br></div><div>I'm trying a very simple programme</div><div>-------------cut-------</div><div><div>#include <iostream></div><div><br></div><div>void main(int argc,char **argv)</div><div>{</div><div>   std::cerr << "Hello World" << std::endl;</div><div>}</div></div><div>-------------cut-------<br></div><div><br></div><div>clang-tidy will work perfectly until I start include system headers,stl etc...</div><div><br></div><div>I run on the command line (inside cygwin bash shell) with the following.</div><div><br></div><div><div>clang-tidy Stdio.cxx -- -I"c:/Program Files (x86)/Microsoft Visual Studio 14.0/VC/INCLUDE" -I"c:/Program Files (x86)/Windows Kits/10/Include/10.0.10150.0/ucrt"</div></div><div><br></div><div><br></div><div>but I get a load of failures due to clang errors in the system headers.</div><div><br></div><div>Can I:</div><div><br></div><div>1) parse a switch to clang-tidy to tell it not to complain about headers outside of my control?</div><div>2) avoid this problem in the first place (I get the same if I try to compile with clang.exe or clang-cl.exe)?</div><div>3) am I making an obvious mistake?</div><div><br></div><div><div>-----------------compiler output-----------------</div><div>8 warnings and 20 errors generated.</div><div>Error while processing D:\buildareas\HEAD\issdev\src\test\tidy\Stdio.cxx.</div><div>error: too many errors emitted, stopping now [clang-diagnostic-error]</div><div>c:/Program Files (x86)/Microsoft Visual Studio 14.0/VC/INCLUDE\vadefs.h:28:33: e</div><div>rror: expected ';' after top level declarator [clang-diagnostic-error]</div><div>        typedef unsigned __int64  uintptr_t;</div><div>                                ^</div><div>                                ;</div><div>c:/Program Files (x86)/Microsoft Visual Studio 14.0/VC/INCLUDE\vadefs.h:127:18:</div><div>error: expected identifier or '{' [clang-diagnostic-error]</div><div>            enum : bool { __the_value = false };</div><div>                 ^</div><div>c:/Program Files (x86)/Microsoft Visual Studio 14.0/VC/INCLUDE\vadefs.h:133:18:</div><div>error: expected identifier or '{' [clang-diagnostic-error]</div><div>            enum : bool { __the_value = true };</div><div>                 ^</div><div>c:/Program Files (x86)/Microsoft Visual Studio 14.0/VC/INCLUDE\vadefs.h:139:18:</div><div>error: expected identifier or '{' [clang-diagnostic-error]</div><div>            enum : bool { __the_value = true };</div><div>                 ^</div><div>c:/Program Files (x86)/Microsoft Visual Studio 14.0/VC/INCLUDE\vcruntime.h:81:1:</div><div> error: C++ requires a type specifier for all declarations [clang-diagnostic-err</div><div>or]</div><div>_CRT_BEGIN_C_HEADER</div></div><div>...... more errors cut</div><div><br></div><div>Many thanks inadvance</div><span><font color="#888888"><div><br></div><div>Paul</div></font></span></div>
<br></div></div><span>_______________________________________________<br>
cfe-dev mailing list<br>
<a href="mailto:cfe-dev@lists.llvm.org" target="_blank">cfe-dev@lists.llvm.org</a><br>
<a href="http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev" rel="noreferrer" target="_blank">http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev</a><br>
<br></span></blockquote></div><br></div>
</blockquote></div><br></div>
</blockquote></div></div>