[PATCH] D26167: [Clang-tidy] check for malloc, realloc and free calls

2016-12-27 Thread Kim Gräsman via Phabricator via cfe-commits
kimgr added a comment. Minor spelling nits inline Comment at: clang-tidy/cppcoreguidelines/NoMallocCheck.cpp:30 + callExpr(callee(functionDecl(hasAnyName("::malloc", "::calloc" + .bind("aquisition"), + this); Spelling nit: acquisition

[PATCH] D26167: [Clang-tidy] check for malloc, realloc and free calls

2016-12-21 Thread Malcolm Parsons via Phabricator via cfe-commits
malcolm.parsons added a comment. In https://reviews.llvm.org/D26167#622792, @malcolm.parsons wrote: > In https://reviews.llvm.org/D26167#621942, @JonasToth wrote: > > > what do you think about configuration of the allocating functions? e.g. for > > aligned memory you must use OS-specific

[PATCH] D26167: [Clang-tidy] check for malloc, realloc and free calls

2016-12-14 Thread Malcolm Parsons via Phabricator via cfe-commits
malcolm.parsons added a comment. In https://reviews.llvm.org/D26167#621942, @JonasToth wrote: > what do you think about configuration of the allocating functions? e.g. for > aligned memory you must use OS-specific allocation functions. > should the check catch custom allocation functions as

[PATCH] D26167: [Clang-tidy] check for malloc, realloc and free calls

2016-12-14 Thread Jonas Toth via Phabricator via cfe-commits
JonasToth added a comment. alright, i will try to get the functionpointers as well. what do you think about configuration of the allocating functions? e.g. for aligned memory you must use OS-specific allocation functions. should the check catch custom allocation functions as well? is there a

[PATCH] D26167: [Clang-tidy] check for malloc, realloc and free calls

2016-12-14 Thread Jonas Devlieghere via Phabricator via cfe-commits
JDevlieghere added a comment. In https://reviews.llvm.org/D26167#621928, @malcolm.parsons wrote: > I tried this check on my company's codebase. > It misses cases where malloc is used through a function pointer. > Should clang-tidy warn about making a function pointer to these functions?

[PATCH] D26167: [Clang-tidy] check for malloc, realloc and free calls

2016-12-14 Thread Malcolm Parsons via Phabricator via cfe-commits
malcolm.parsons added a comment. I tried this check on my company's codebase. It misses cases where malloc is used through a function pointer. Should clang-tidy warn about making a function pointer to these functions? Repository: rL LLVM https://reviews.llvm.org/D26167

[PATCH] D26167: [Clang-tidy] check for malloc, realloc and free calls

2016-12-13 Thread Reid Kleckner via Phabricator via cfe-commits
rnk added a comment. nit: All of the new files had UTF-8 BOMs, which I don't think we usually add. Comment at: test/clang-tidy/cppcoreguidelines-no-malloc.cpp:3 + +using size_t = unsigned long; + This test did not pass on 32-bit Windows. I will change it to:

[PATCH] D26167: [Clang-tidy] check for malloc, realloc and free calls

2016-12-13 Thread Alexander Kornienko via Phabricator via cfe-commits
alexfh added a comment. Committed in r289546. Repository: rL LLVM https://reviews.llvm.org/D26167 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[PATCH] D26167: [Clang-tidy] check for malloc, realloc and free calls

2016-12-13 Thread Jonas Toth via Phabricator via cfe-commits
JonasToth added a comment. In https://reviews.llvm.org/D26167#621106, @alexfh wrote: > Jonas, do you need someone to commit the patch for you? i think so, yes. can i trigger somehow automatically, that this will go into the code base somehow? Repository: rL LLVM

[PATCH] D26167: [Clang-tidy] check for malloc, realloc and free calls

2016-12-13 Thread Jonas Toth via Phabricator via cfe-commits
JonasToth added a comment. tbh. i dont know anything how the clang workflow works :) do i need to ask someone to commit, or what be my next step? Repository: rL LLVM https://reviews.llvm.org/D26167 ___ cfe-commits mailing list

[PATCH] D26167: [Clang-tidy] check for malloc, realloc and free calls

2016-12-13 Thread Alexander Kornienko via Phabricator via cfe-commits
alexfh added a comment. Jonas, do you need someone to commit the patch for you? Repository: rL LLVM https://reviews.llvm.org/D26167 ___ cfe-commits mailing list cfe-commits@lists.llvm.org

[PATCH] D26167: [Clang-tidy] check for malloc, realloc and free calls

2016-12-13 Thread Malcolm Parsons via Phabricator via cfe-commits
malcolm.parsons accepted this revision. malcolm.parsons added a comment. LGTM. Repository: rL LLVM https://reviews.llvm.org/D26167 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[PATCH] D26167: [Clang-tidy] check for malloc, realloc and free calls

2016-12-13 Thread Alexander Kornienko via Phabricator via cfe-commits
alexfh added a comment. Hit "submit" too early. LG, but please wait until Malcolm is happy with the change as well. Repository: rL LLVM https://reviews.llvm.org/D26167 ___ cfe-commits mailing list cfe-commits@lists.llvm.org

[PATCH] D26167: [Clang-tidy] check for malloc, realloc and free calls

2016-12-13 Thread Alexander Kornienko via Phabricator via cfe-commits
alexfh accepted this revision. alexfh added a comment. This revision is now accepted and ready to land. LG, but please wait until Malcolm > Whats not nice is, that there is no underlining (in test neither), but i > could not find out what is wrong, > since i supply a SourceRange in the

[PATCH] D26167: [Clang-tidy] check for malloc, realloc and free calls

2016-12-13 Thread Jonas Toth via Phabricator via cfe-commits
JonasToth marked 4 inline comments as done. JonasToth added inline comments. Comment at: docs/clang-tidy/checks/cppcoreguidelines-no-malloc.rst:10 +See `C++ Core Guidelines +` +

[PATCH] D26167: [Clang-tidy] check for malloc, realloc and free calls

2016-12-13 Thread Jonas Toth via Phabricator via cfe-commits
JonasToth updated this revision to Diff 81208. JonasToth added a comment. adjusted doc. Repository: rL LLVM https://reviews.llvm.org/D26167 Files: clang-tidy/cppcoreguidelines/CMakeLists.txt clang-tidy/cppcoreguidelines/CppCoreGuidelinesTidyModule.cpp

[PATCH] D26167: [Clang-tidy] check for malloc, realloc and free calls

2016-12-13 Thread Malcolm Parsons via Phabricator via cfe-commits
malcolm.parsons added inline comments. Comment at: docs/clang-tidy/checks/cppcoreguidelines-no-malloc.rst:10 +See `C++ Core Guidelines +` + JonasToth wrote: >

[PATCH] D26167: [Clang-tidy] check for malloc, realloc and free calls

2016-12-13 Thread Jonas Toth via Phabricator via cfe-commits
JonasToth updated this revision to Diff 81204. JonasToth added a comment. fix missing variable in doc Repository: rL LLVM https://reviews.llvm.org/D26167 Files: clang-tidy/cppcoreguidelines/CMakeLists.txt clang-tidy/cppcoreguidelines/CppCoreGuidelinesTidyModule.cpp

[PATCH] D26167: [Clang-tidy] check for malloc, realloc and free calls

2016-12-13 Thread Jonas Toth via Phabricator via cfe-commits
JonasToth marked an inline comment as done. JonasToth added inline comments. Comment at: clang-tidy/cppcoreguidelines/NoMallocCheck.cpp:29 + Finder->addMatcher( + callExpr(callee(functionDecl(hasAnyName("::malloc", "::calloc" + .bind("aquisition"),

[PATCH] D26167: [Clang-tidy] check for malloc, realloc and free calls

2016-12-13 Thread Jonas Toth via Phabricator via cfe-commits
JonasToth marked an inline comment as done. JonasToth added inline comments. Comment at: docs/clang-tidy/checks/cppcoreguidelines-no-malloc.rst:10 +See `C++ Core Guidelines +` +

[PATCH] D26167: [Clang-tidy] check for malloc, realloc and free calls

2016-12-13 Thread Malcolm Parsons via Phabricator via cfe-commits
malcolm.parsons added inline comments. Comment at: clang-tidy/cppcoreguidelines/NoMallocCheck.cpp:29 + Finder->addMatcher( + callExpr(callee(functionDecl(hasAnyName("::malloc", "::calloc" + .bind("aquisition"), C memory management functions

[PATCH] D26167: [Clang-tidy] check for malloc, realloc and free calls

2016-12-13 Thread Jonas Toth via Phabricator via cfe-commits
JonasToth added a comment. I did run clang-tidy with $(./run-clang-tidy.py -checks=-*,cppcoreguidelines-no-malloc). The resulting output is in the appended file. Since all warnings came from header files (llvms custom containers?) there are always the same warnings for all source files. Every

[PATCH] D26167: [Clang-tidy] check for malloc, realloc and free calls

2016-12-13 Thread Jonas Toth via Phabricator via cfe-commits
JonasToth updated this revision to Diff 81193. JonasToth marked 2 inline comments as done. JonasToth added a comment. last fixes in the code, from alex Repository: rL LLVM https://reviews.llvm.org/D26167 Files: clang-tidy/cppcoreguidelines/CMakeLists.txt

[PATCH] D26167: [Clang-tidy] check for malloc, realloc and free calls

2016-12-12 Thread Alexander Kornienko via Phabricator via cfe-commits
alexfh requested changes to this revision. alexfh added a comment. This revision now requires changes to proceed. One important thing is missing. Please run this check on a large enough codebase (LLVM + Clang is a good choice for testing most of kinds of checks usually) and include a summary of

[PATCH] D26167: [Clang-tidy] check for malloc, realloc and free calls

2016-12-12 Thread Jonas Toth via Phabricator via cfe-commits
JonasToth updated this revision to Diff 81103. JonasToth added a comment. fixes last review comments from alex Repository: rL LLVM https://reviews.llvm.org/D26167 Files: clang-tidy/cppcoreguidelines/CMakeLists.txt clang-tidy/cppcoreguidelines/CppCoreGuidelinesTidyModule.cpp

[PATCH] D26167: [Clang-tidy] check for malloc, realloc and free calls

2016-12-12 Thread Jonas Toth via Phabricator via cfe-commits
JonasToth marked 3 inline comments as done. JonasToth added a comment. removed the function calls, a little doc tidy as well Repository: rL LLVM https://reviews.llvm.org/D26167 ___ cfe-commits mailing list cfe-commits@lists.llvm.org

[PATCH] D26167: [Clang-tidy] check for malloc, realloc and free calls

2016-12-12 Thread Alexander Kornienko via Phabricator via cfe-commits
alexfh requested changes to this revision. alexfh added inline comments. This revision now requires changes to proceed. Comment at: clang-tidy/cppcoreguidelines/NoMallocCheck.cpp:54 + +void NoMallocCheck::handleAquisition(const CallExpr *AquisitionCall) { +