This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH] rs6000: Shut up -Wformat-diag somewhat
Segher Boessenkool <segher@kernel.crashing.org> writes:
> We currently get lot of build warnings like
> /home/segher/src/gcc/gcc/config/rs6000/rs6000-c.c:7039:12: warning: misspelled term 'builtin function' in format; use 'built-in function' instead [-Wformat-diag]
> 7039 | error ("builtin function %qs not supported in this compiler "
> | ^~~~~~~~~~~~~~~~
>
> That would print something like
> builtin function '__builtin_example' not supported in this compiler
>
> Changing that to "built-in" as suggested only makes this worse.
> Instead, let's just remove the whole "builtin function" phrase.
>
> Tested on powerpc64-linux {-m32,-m64}; committing.
>
>
> Segher
>
>
> 2019-07-13 Segher Boessenkool <segher@kernel.crashing.org>
>
> PR target/91148
> * config/rs6000/rs6000.c (rs6000_invalid_builtin): Remove superfluous
> "builtin function" phrasing.
Sounded from the above like there was supposed to be a rs6000-c.c
change as well. Just saying because IMO "X not supported..." seems
unnecessarily awkward compared to...
> diff --git a/gcc/config/rs6000/rs6000.c b/gcc/config/rs6000/rs6000.c
> index 65df8d6..e199748 100644
> --- a/gcc/config/rs6000/rs6000.c
> +++ b/gcc/config/rs6000/rs6000.c
> @@ -14744,62 +14744,53 @@ rs6000_invalid_builtin (enum rs6000_builtins fncode)
>
> gcc_assert (name != NULL);
> if ((fnmask & RS6000_BTM_CELL) != 0)
> - error ("builtin function %qs is only valid for the cell processor", name);
> + error ("%qs is only valid for the cell processor", name);
> else if ((fnmask & RS6000_BTM_VSX) != 0)
> - error ("builtin function %qs requires the %qs option", name, "-mvsx");
> + error ("%qs requires the %qs option", name, "-mvsx");
> else if ((fnmask & RS6000_BTM_HTM) != 0)
> - error ("builtin function %qs requires the %qs option", name, "-mhtm");
> + error ("%qs requires the %qs option", name, "-mhtm");
> else if ((fnmask & RS6000_BTM_ALTIVEC) != 0)
> - error ("builtin function %qs requires the %qs option", name, "-maltivec");
> + error ("%qs requires the %qs option", name, "-maltivec");
> else if ((fnmask & (RS6000_BTM_DFP | RS6000_BTM_P8_VECTOR))
> == (RS6000_BTM_DFP | RS6000_BTM_P8_VECTOR))
> - error ("builtin function %qs requires the %qs and %qs options",
> - name, "-mhard-dfp", "-mpower8-vector");
> - else if ((fnmask & RS6000_BTM_DFP) != 0)
> - error ("builtin function %qs requires the %qs option", name, "-mhard-dfp");
> - else if ((fnmask & RS6000_BTM_P8_VECTOR) != 0)
> - error ("builtin function %qs requires the %qs option", name,
> + error ("%qs requires the %qs and %qs options", name, "-mhard-dfp",
> "-mpower8-vector");
> + else if ((fnmask & RS6000_BTM_DFP) != 0)
> + error ("%qs requires the %qs option", name, "-mhard-dfp");
> + else if ((fnmask & RS6000_BTM_P8_VECTOR) != 0)
> + error ("%qs requires the %qs option", name, "-mpower8-vector");
> else if ((fnmask & (RS6000_BTM_P9_VECTOR | RS6000_BTM_64BIT))
> == (RS6000_BTM_P9_VECTOR | RS6000_BTM_64BIT))
> - error ("builtin function %qs requires the %qs and %qs options",
> - name, "-mcpu=power9", "-m64");
> + error ("%qs requires the %qs and %qs options", name, "-mcpu=power9",
> + "-m64");
> else if ((fnmask & RS6000_BTM_P9_VECTOR) != 0)
> - error ("builtin function %qs requires the %qs option", name,
> - "-mcpu=power9");
> + error ("%qs requires the %qs option", name, "-mcpu=power9");
> else if ((fnmask & (RS6000_BTM_P9_MISC | RS6000_BTM_64BIT))
> == (RS6000_BTM_P9_MISC | RS6000_BTM_64BIT))
> - error ("builtin function %qs requires the %qs and %qs options",
> - name, "-mcpu=power9", "-m64");
> + error ("%qs requires the %qs and %qs options", name, "-mcpu=power9",
> + "-m64");
> else if ((fnmask & RS6000_BTM_P9_MISC) == RS6000_BTM_P9_MISC)
> - error ("builtin function %qs requires the %qs option", name,
> - "-mcpu=power9");
> + error ("%qs requires the %qs option", name, "-mcpu=power9");
> else if ((fnmask & RS6000_BTM_LDBL128) == RS6000_BTM_LDBL128)
> {
> if (!TARGET_HARD_FLOAT)
> - error ("builtin function %qs requires the %qs option", name,
> - "-mhard-float");
> + error ("%qs requires the %qs option", name, "-mhard-float");
> else
> - error ("builtin function %qs requires the %qs option", name,
> + error ("%qs requires the %qs option", name,
> TARGET_IEEEQUAD ? "-mabi=ibmlongdouble" : "-mlong-double-128");
> }
> else if ((fnmask & RS6000_BTM_HARD_FLOAT) != 0)
> - error ("builtin function %qs requires the %qs option", name,
> - "-mhard-float");
> + error ("%qs requires the %qs option", name, "-mhard-float");
> else if ((fnmask & RS6000_BTM_FLOAT128_HW) != 0)
> - error ("builtin function %qs requires ISA 3.0 IEEE 128-bit floating point",
> - name);
> + error ("%qs requires ISA 3.0 IEEE 128-bit floating point", name);
> else if ((fnmask & RS6000_BTM_FLOAT128) != 0)
> - error ("builtin function %qs requires the %qs option", name,
> - "%<-mfloat128%>");
> + error ("%qs requires the %qs option", name, "%<-mfloat128%>");
> else if ((fnmask & (RS6000_BTM_POPCNTD | RS6000_BTM_POWERPC64))
> == (RS6000_BTM_POPCNTD | RS6000_BTM_POWERPC64))
> - error ("builtin function %qs requires the %qs (or newer), and "
> - "%qs or %qs options",
> + error ("%qs requires the %qs (or newer), and %qs or %qs options",
> name, "-mcpu=power7", "-m64", "-mpowerpc64");
> else
> - error ("builtin function %qs is not supported with the current options",
> - name);
> + error ("%qs is not supported with the current options", name);
> }
...these, which all have verbs and read nicely.
Sorry for indulging a pet peeve. :-)
Thanks,
Richard