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
Replace 0 with nullptr or 'null pointer value'. #872
Conversation
@@ -2520,7 +2520,7 @@ | |||
s)~(\ref{multibyte.strings}) and \tcode{argv[0]} shall be the pointer to | |||
the initial character of a \ntmbs that represents the name used to | |||
invoke the program or \tcode{""}. The value of \tcode{argc} shall be | |||
non-negative. The value of \tcode{argv[argc]} shall be 0. \begin{note} It | |||
non-negative. The value of \tcode{argv[argc]} shall be \tcode{nullptr}. \begin{note} It | |||
is recommended that any further (optional) parameters be added after |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hm, well, argv[argc]
is of type char*
, not std::nullptr_t
, so I'm not sure this is accurate. It wasn't accurate in the first place, but perhaps we should fix that instead. ("... shall be a null"?)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good point, I've added a second commit to address that.
@@ -85,7 +85,7 @@ | |||
and | |||
\tcode{0L}, | |||
but not | |||
\tcode{(void*)0}.} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should probably stay.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fair enough, reverted that one.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please revert the changes to the core language clauses; we intentionally do not have a consistent style for core language examples, in order to give a broad set of different styles and to avoid implying that the language expects a particular style to be used.
However, within the library description, we should consistently be using nullptr, and those changes here look good.
@@ -2520,7 +2520,7 @@ | |||
s)~(\ref{multibyte.strings}) and \tcode{argv[0]} shall be the pointer to | |||
the initial character of a \ntmbs that represents the name used to | |||
invoke the program or \tcode{""}. The value of \tcode{argc} shall be | |||
non-negative. The value of \tcode{argv[argc]} shall be 0. \begin{note} It | |||
non-negative. The value of \tcode{argv[argc]} shall be the null pointer value. \begin{note} It |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the -> a, please
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also in the other occurrences below. We can have "the null pointer value of some type", but "the null pointer value" without a type doesn't make sense, whereas "a null pointer value" seems to work.
@@ -1509,7 +1509,7 @@ | |||
\tcode{parray[idx]}. | |||
On failure a valid | |||
\tcode{void*\&} | |||
initialized to 0. | |||
initialized to the null pointer value. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This doesn't make any sense, with or without your change. You can't initialize a void*&
to a null pointer value. To what object is this reference supposed to be bound? This seems like we need an LWG issue to say what this actually does.
@Eelis: ping |
I manually went over all occurrences of 0 in the document, so modulo human error this should be all of them.
visual diff