Warning flag

Open
#66 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
1/5
Estimated time
Under an hour
Newbie friendliness
58/100
Issue type
Documentation
Clarity
Clearly specified
Activity status
Stale
Tech stack
cpp
Domain
documentation

Research direction

Open 02-Use_the_Tools_Available.md at the GCC / Clang warning flag list, and review the related nullptr guidance in 03-Style.md. Document GCC's -Wzero-as-null-pointer-constant with accurate compiler scope; the issue is done when the warning appears correctly in the relevant list.

Written by the indexing model from the issue text.

Description

Hello,

In your 03-Style.md best practice file you talk about using nullptr instead of 0 or NULL which is a very good things to do.

There is a flag in GCC that warn the user about using 0 (or NULL) instead of nullptr: -Wzero-as-null-pointer-constant. Unfortunately this flag does not exists for clang and I don't know if it does for MSVC.

I think this should be a good idea to add this flag in your warning flag list (https://github.com/lefticus/cppbestpractices/blob/master/02-Use_the_Tools_Available.md#gcc--clang).

Best regards

Dominant language
No language data
Stars
8.9k
Forks
901
PR merge metrics
No merged PRs in 30d

Getting set up

This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from cpp-best-practices/cppbestpractices

All issues in cpp-best-practices/cppbestpractices

Similar issues

More Documentation issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.