[cfe-dev] Patch for compilation on msvc

Cédric Venet cedric.venet at laposte.net
Sat Feb 16 14:21:22 PST 2008


Hi,

This is a patch for clang and one for llvm (perhaps should post it on llvm
mailing list) allowing to build clang without error on MSVC2005.

Mainly project change but also a few missing std include header and one
compiler bug (or not, I don't know what the standard say):

for (GRExprEngine::null_iterator I=CheckerState->null_begin(),
         E=CheckerState->null_end(); I!=E; ++I) {
      
      const PostStmt& L = cast<PostStmt>((*I)->getLocation());
      Expr* E = cast<Expr>(L.getStmt());
      
      Diag.Report(FullSourceLoc(E->getExprLoc(), Ctx.getSourceManager()),
                  diag::chkr_null_deref_after_check);
    }

Not Expr* E who redefine E from the for initialization. Is it the same
scope? The strangest thing was that MSVC didn't complain about redefinition
but seemed to ignore the Expr* E; definition and was thinking E was a
null_iterator. Took me some time to understand the problem.

Didn't run the test, but it compile without error (not without warning...)

Regards,

Ps: What should I use as LLVM_HOSTTRIPLE: "i386-win32-WinXP" ??
-------------- next part --------------
A non-text attachment was scrubbed...
Name: llvm-msvc.patch
Type: application/octet-stream
Size: 28387 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20080216/bfeb23b7/attachment.obj>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: clang-msvc.patch
Type: application/octet-stream
Size: 7708 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20080216/bfeb23b7/attachment-0001.obj>


More information about the cfe-dev mailing list