Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
matejk opened this issue Dec 15, 2023 · 2 comments
Open

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

matejk opened this issue Dec 15, 2023 · 2 comments

Comments

@matejk
Copy link
Contributor

matejk commented Dec 15, 2023

As described in the title.

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

@teksturi
Copy link
Contributor

teksturi commented Dec 16, 2023

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

This was referenced Dec 16, 2023
@aleks-f
Copy link
Member

aleks-f commented Dec 19, 2023

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.

@matejk matejk added this to the Release 1.14.0 milestone Dec 22, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: No status
Development

No branches or pull requests

3 participants