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

Replace 0 with nullptr or 'null pointer value'. #872

Closed
wants to merge 2 commits into from

Conversation

Eelis
Copy link
Contributor

@Eelis Eelis commented Aug 1, 2016

I manually went over all occurrences of 0 in the document, so modulo human error this should be all of them.

visual diff

@@ -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
Copy link
Contributor

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"?)

Copy link
Contributor Author

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.

@Eelis Eelis changed the title Replace 0 with nullptr where appropriate. Replace 0 with nullptr or 'null pointer value'. Aug 1, 2016
@@ -85,7 +85,7 @@
and
\tcode{0L},
but not
\tcode{(void*)0}.}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should probably stay.

Copy link
Contributor Author

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.

@tkoeppe
Copy link
Contributor

tkoeppe commented Sep 25, 2016

@jwakely, @zygoloid: PTAL

Copy link
Member

@zygoloid zygoloid left a 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
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the -> a, please

Copy link
Member

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.
Copy link
Member

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.

@tkoeppe
Copy link
Contributor

tkoeppe commented Nov 17, 2016

@Eelis: ping

@Eelis Eelis closed this Nov 17, 2016
@Eelis Eelis deleted the nullptr branch November 17, 2016 22:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants