poco icon indicating copy to clipboard operation
poco copied to clipboard

0 (or NULL) for null pointer shall be replaced with nullptr

Open matejk opened this issue 1 year ago • 2 comments

As described in the title.

Warning option -Wzero-as-null-pointer-constant can be used to locate places in the code.

matejk avatar Dec 15 '23 20:12 matejk

I recommend using clang-tidy for these kind of things. We should automate these kind of things. Else it means more work to keep track. If these are not automated it is harder and harder new dev to come in to the project and follow all rules.

Here nice blog post https://www.kdab.com/clang-tidy-part-1-modernize-source-code-using-c11c14/

We probably just need to start keeping list of external files or move them to own directory. I actually vote for own folder idea for those. Eather common external/third party source dir or our every lib get's own. This thing will have many benefits.

  • Easy to keep track of external debencies.
  • Easy way ignore those so they are not changed so easily
  • Easiear to check update for all of those
  • We can exlude them from code format automations.
  • For new dev it is very documentaries
  • We can exclude build warnings from them very easily

See example how chromium does it https://github.com/chromium/chromium/tree/main/third_party

teksturi avatar Dec 16 '23 06:12 teksturi

I recommend using clang-tidy for these kind of things. We should automate these kind of things. Else it means more work to keep track. If these are not automated it is harder and harder new dev to come in to the project and follow all rules.

i am in favor of this. It will, however, require the buildsystems (CMake is the official buildsystem, but makefiles and pre-generated VS projects should stay, too) modifications. Best to create a separate issue for this.

aleks-f avatar Dec 19 '23 20:12 aleks-f