On Thu, May 07, 2020 at 12:34:44PM -0600, Martin Sebor wrote: > On 5/7/20 11:24 AM, Marek Polacek wrote: > > On Thu, Mar 19, 2020 at 12:51:42PM -0400, Marek Polacek via Gcc-patches > > wrote: > > > On Thu, Mar 19, 2020 at 10:45:01AM -0600, Martin Sebor via Gcc-patches > > > wrote: > > > > On 3/19/20 9:48 AM, Marek Polacek via Gcc-patches wrote: > > > > > I was looking at DR 296 and noticed that we say "nonstatic" instead of > > > > > "non-static", which is the version the standard uses. So this patch > > > > > fixes the spelling throughout the front end. Did not check e.g. > > > > > non-dependent or any other. > > > > > > > > > > Bootstrapped/regtested on x86_64-linux, ok for trunk? > > > > > > > > If this is the spelling we want to standardize on, would you mind > > > > adding a check to -Wformat-diag as well so these misspellings get > > > > diagnosed in diagnostic messages? We might also want to add > > > > a mention of it to the Spelling section of the GCC Coding > > > > Conventions. > > > > > > Good point, I can definitely add it. For now I'm putting this aside > > > though. > > > > Actually, I wasn't sure where to add such a diagnostic, check_plain doesn't > > seem > > to already check for similar typos, so I'll just go ahead with my patch > > as-is. > > Thanks for remembering this! I think the word should be added to > the badwords array (above "non-static"). But I can do that if you > prefer. Looks like I'll be doing some work in this space anyway.
Oof, how did I miss that? Does this patch look OK to you then? Not sure if it deserves a test, I would think not. * c-format.c (badwords): Add "nonstatic". --- gcc/c-family/c-format.c | 1 + 1 file changed, 1 insertion(+) diff --git a/gcc/c-family/c-format.c b/gcc/c-family/c-format.c index 33a5b6d3965..77d24ad94e4 100644 --- a/gcc/c-family/c-format.c +++ b/gcc/c-family/c-format.c @@ -2997,6 +2997,7 @@ static const struct NAME ("decl", "declaration"), NAME ("enumeral", "enumerated"), NAME ("floating point", "floating-point"), + NAME ("nonstatic", "non-static"), NAME ("non-zero", "nonzero"), NAME ("reg", "register"), NAME ("stmt", "statement"), base-commit: 5d5dcc65aae1024da31e0e9cae6a8966461037e8 -- Marek Polacek • Red Hat, Inc. • 300 A St, Boston, MA