[patch] fix -Wformat-diag warnings in rs6000-call.c

Segher Boessenkool segher@kernel.crashing.org
Tue Jan 12 21:32:37 GMT 2021


Hi!

On Sun, Jan 10, 2021 at 02:18:24PM -0700, Martin Sebor wrote:
> Symbols/identifiers should be formatted using the appropriate
> directives or quoted in %< %>.

We do not have a way to mark up the mathematical symbols [], but we do
require those to express ranges (which is a bad idea /an sich/, but
that aside).

> The purpose of the -Wformat-diag warnings is to improve the consistency
> of user-visible messages

Which is not a good idea in and of itself.  It *is* good to identify bad
practices, of course, but to make the GCC feedback more dull and
formalised only makes it harder to find where an error came from (and
seeing that as a positive thing requires a special kind of mind
already ;-) ).

> and make them easier to translate.

That can be helpful.

> There was
> a discussion some time back about whether internal errors should fall
> into this category.

IMNSHO it is counter-productive to translate internal messages at all.
Can we automatically mark those as non-translated?

> I'm not sure if it reached a conclusion one way
> or the other but in similar situations elsewhere in GCC we have
> suppressed the warning via #pragma GCC diagnostic.

This isn't needed then either.  Win-win-win!

> If it takes too
> much effort to clean them up it might make sense to do the same here
> (the downside is that it doesn't help translators).  Otherwise,
> the messages are not really phrased in a way that's comprehensible
> either to users or to tranlators (acronyms like elt or rtx aren't 
> universally understood).

Neither translators or even users are an audience for those messages at
all: the only thing they should see is "internal error", and perhaps
how to report it.  Reporting a translated version of the message is a
bad idea.


Segher


More information about the Gcc-patches mailing list