quda icon indicating copy to clipboard operation
quda copied to clipboard

NULL and nullptr

Open cpviolator opened this issue 5 years ago • 6 comments

Library wide, QUDA should use nullptr rather than NULL. A bash script that incrementally changes and commits should do the trick, specifically targeting NULL), ,NULL and NULL; to avoid messing with QUDA_NULL_FIELD_CREATE and comments.

cpviolator avatar Apr 28 '20 22:04 cpviolator

what we want to use here is probably clang-tidy

mathiaswagner avatar May 16 '20 04:05 mathiaswagner

@mathiaswagner https://clang.llvm.org/extra/clang-tidy/checks/modernize-use-nullptr.html ?

cpviolator avatar May 16 '20 05:05 cpviolator

Yes. Note that a ton of the modernize checks could probably be applied to QUDA and we should strive to modernize files that are touched anyway. Looking into this has been on my list for quite a while now.

mathiaswagner avatar May 16 '20 05:05 mathiaswagner

Shall we make this a goal for 2.0?

cpviolator avatar May 16 '20 05:05 cpviolator

Sure. We should work out a strategy. Some early thoughts

  • which checks to use (might require a minimum version)
  • when to apply them to which files (doing one mega pull for all of QUDA might only take us to merge hell)

...

mathiaswagner avatar May 16 '20 06:05 mathiaswagner

For reference as it seems useful: https://blog.kitware.com/static-checks-with-cmake-cdash-iwyu-clang-tidy-lwyu-cpplint-and-cppcheck/

mathiaswagner avatar May 25 '20 06:05 mathiaswagner