This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH 1/7] Add missing punctuation to message (PR driver/79875)


On 03/09/2017 10:45 AM, David Malcolm wrote:
gcc/ChangeLog:
	PR driver/79875
	* opts.c (parse_sanitizer_options): Add missing question mark to
	"did you mean" message.
---
 gcc/opts.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/gcc/opts.c b/gcc/opts.c
index 8274fab..6ea57af 100644
--- a/gcc/opts.c
+++ b/gcc/opts.c
@@ -1640,7 +1640,7 @@ parse_sanitizer_options (const char *p, location_t loc, int scode,
 	  if (hint)
 	    error_at (loc,
 		      "unrecognized argument to -f%ssanitize%s= option: %q.*s;"
-		      " did you mean %qs",
+		      " did you mean %qs?",

I have just an observation/question here for future consideration.
If this sort of diagnostic is common (I count 23 instances of it)
or if it is expected to become common, would it make sense to add
a directive for it to the pretty printer to ensure consistency?
I.e., to automatically prepend "; did you mean" and append the
"?" to the new directive?

My search shows the following forms:

1) Space before "?"
gcc/c-family/c-common.c: "%<<<%> in boolean context, did you mean %<<%> ?");

2) No question mark at the end:
gcc/git/gcc/opts.c: "unrecognized argument to -f%ssanitize%s= option: %q.*s;"
		      " did you mean %qs",
		      value ? "" : "no-",

3) Missing space after semicolon:

gcc/c/c-decl.c: G_("implicit declaration of function %qE;did you mean %qs?"),

4) Explicit quotes:
gcc/gensupport.c: message_at (loc, "(did you mean \"%s\"?)",

(though this won't be fixed by the suggested directive).

Martin


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]