opts: Change `is incompatible with` messages to have standard parametrised form
authorMatthew Malcomson <matthew.malcomson@arm.com>
Tue, 10 Nov 2020 17:14:47 +0000 (17:14 +0000)
committerMatthew Malcomson <matthew.malcomson@arm.com>
Tue, 10 Nov 2020 17:14:47 +0000 (17:14 +0000)
commit2cca9751700946f1398fc3bcb96d529bb2964f0f
treed4bf1197b641c86787d0fa11d72af6fddcbb3bce
parent831f24a778a016c6ce1ae739235e3f7e1f28ed8c
opts: Change `is incompatible with` messages to have standard parametrised form

Hello,

In a recent review for one of the hwasan patches Richard S. noticed there are
quite a few errors of the form "%<someflag%> is incompatible with
<otherflag%>".
https://gcc.gnu.org/pipermail/gcc-patches/2020-October/556137.html

In order to avoid this creating extra work for translators we would like to
change these error messages to use the form "%qs is incompatible with %qs" and
pass the flag as format arguments.

This patch implements that change.
There is only one change in the output the compiler produces from this patch,
an error message of "-fsanitize=address and -fsanitize=kernel-address are
incompatible with -fsanitize=thread" has been changed to "-fsanitize=thread is
incompatible with -fsanitize=address|kernel-address".
This matches the similar error messages for live patching which use the
messages "-f<something> is incompatible with
-flive-patching=inline-only-static|inline-clone".

Ok for trunk?

gcc/ChangeLog:

* opts.c (control_options_for_live_patching): Reform 'is incompatible
with' error messages to use a standard message with differing format
arguments.
(finish_options): Likewise.

gcc/testsuite/ChangeLog:

* c-c++-common/ubsan/sanitize-recover-7.c: Update testcase.
gcc/opts.c
gcc/testsuite/c-c++-common/ubsan/sanitize-recover-7.c