martong accepted this revision. martong added a reviewer: whisperity. martong added a subscriber: whisperity. martong added a comment. This revision is now accepted and ready to land.
We had a discussion about this with @dkrupp . We think that the `p = realloc(p, var)` construct in itself is an error-prone **style** of using `realloc`. This style does not necessarily give birth to erroneous code (see the error-free escaping example in `foo` above from @steakhal). However, the form `p = realloc(p, var)` is an indication that the programmer might missed the non-trivial error handling case, and chances are high. Thus, one should use the `p2 = realloc(p1, var)` form as a best practice. So, this looks good to me, but please consider this a weak approve and wait for someone else's approve who has more confidence in clang-tidy (@whisperity could you please take a look?). Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D133119/new/ https://reviews.llvm.org/D133119 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits