Hi! After hinting Marek to use const char *const in his G_ addition patch, I've grepped for other similar cases. The number_of_iterations_exit code doesn't make sense after we ended up (change from 6.x) with only a single wording, and in the C++ FE the addition of const allows -Wformat to see those format strings.
Bootstrapped/regtested on x86_64-linux and i686-linux, ok for trunk? 2017-02-24 Jakub Jelinek <ja...@redhat.com> * tree-ssa-loop-niter.c (number_of_iterations_exit): Simplify warning. cp/ * call.c (build_op_delete_call): Make msg1 and msg2 const. --- gcc/tree-ssa-loop-niter.c.jj 2017-01-24 23:29:05.000000000 +0100 +++ gcc/tree-ssa-loop-niter.c 2017-02-24 15:34:24.119941951 +0100 @@ -2362,13 +2362,9 @@ number_of_iterations_exit (struct loop * return true; if (warn) - { - const char *wording; - - wording = N_("missed loop optimization, the loop counter may overflow"); - warning_at (gimple_location_safe (stmt), - OPT_Wunsafe_loop_optimizations, "%s", gettext (wording)); - } + warning_at (gimple_location_safe (stmt), + OPT_Wunsafe_loop_optimizations, + "missed loop optimization, the loop counter may overflow"); return false; } --- gcc/cp/call.c.jj 2017-02-23 08:40:30.000000000 +0100 +++ gcc/cp/call.c 2017-02-24 15:31:49.041955772 +0100 @@ -6225,10 +6225,10 @@ build_op_delete_call (enum tree_code cod allocation function, the program is ill-formed." */ if (second_parm_is_size_t (fn)) { - const char *msg1 + const char *const msg1 = G_("exception cleanup for this placement new selects " "non-placement operator delete"); - const char *msg2 + const char *const msg2 = G_("%qD is a usual (non-placement) deallocation " "function in C++14 (or with -fsized-deallocation)"); Jakub