]> git.ipfire.org Git - thirdparty/gcc.git/commit - gcc/c-family/known-headers.cc
c/c++: use positive tone in missing header notes [PR84890]
authorDavid Malcolm <dmalcolm@redhat.com>
Tue, 13 Jun 2023 21:42:47 +0000 (17:42 -0400)
committerDavid Malcolm <dmalcolm@redhat.com>
Tue, 13 Jun 2023 21:42:47 +0000 (17:42 -0400)
commit7474c46cf2d3715fe23871671c756fd5f65bc225
tree2b7cf075d40302935f095ea846aa157fc7b50e69
parent5a897036187468d4ded330b90b2abdaff5061ed6
c/c++: use positive tone in missing header notes [PR84890]

Quoting "How a computer should talk to people" (as quoted
in "Concepts Error Messages for Humans"):

"Various negative tones or actions are unfriendly: being manipulative,
not giving a second chance, talking down, using fashionable slang,
blaming. We must not seem to blame the person. We should avoid suggesting
that the person is inadequate. Phrases like "you forgot" may seem
harmless, but what if a computer said this to you four or five times in
two minutes? Anyway, the person may disagree, so why risk offense?"

gcc/c-family/ChangeLog:
PR c/84890
* known-headers.cc
(suggest_missing_header::~suggest_missing_header): Reword note to
avoid negative tone of "forgetting".

gcc/cp/ChangeLog:
PR c/84890
* name-lookup.cc (missing_std_header::~missing_std_header): Reword
note to avoid negative tone of "forgetting".

gcc/testsuite/ChangeLog:
PR c/84890
* g++.dg/cpp2a/srcloc3.C: Update expected message.
* g++.dg/lookup/missing-std-include-2.C: Likewise.
* g++.dg/lookup/missing-std-include-3.C: Likewise.
* g++.dg/lookup/missing-std-include-6.C: Likewise.
* g++.dg/lookup/missing-std-include.C: Likewise.
* g++.dg/spellcheck-inttypes.C: Likewise.
* g++.dg/spellcheck-stdint.C: Likewise.
* g++.dg/spellcheck-stdlib.C: Likewise.
* gcc.dg/spellcheck-inttypes.c: Likewise.
* gcc.dg/spellcheck-stdbool.c: Likewise.
* gcc.dg/spellcheck-stdint.c: Likewise.
* gcc.dg/spellcheck-stdlib.c: Likewise.

Signed-off-by: David Malcolm <dmalcolm@redhat.com>
14 files changed:
gcc/c-family/known-headers.cc
gcc/cp/name-lookup.cc
gcc/testsuite/g++.dg/cpp2a/srcloc3.C
gcc/testsuite/g++.dg/lookup/missing-std-include-2.C
gcc/testsuite/g++.dg/lookup/missing-std-include-3.C
gcc/testsuite/g++.dg/lookup/missing-std-include-6.C
gcc/testsuite/g++.dg/lookup/missing-std-include.C
gcc/testsuite/g++.dg/spellcheck-inttypes.C
gcc/testsuite/g++.dg/spellcheck-stdint.C
gcc/testsuite/g++.dg/spellcheck-stdlib.C
gcc/testsuite/gcc.dg/spellcheck-inttypes.c
gcc/testsuite/gcc.dg/spellcheck-stdbool.c
gcc/testsuite/gcc.dg/spellcheck-stdint.c
gcc/testsuite/gcc.dg/spellcheck-stdlib.c