https://gcc.gnu.org/bugzilla/show_bug.cgi?id=87041

--- Comment #2 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
That change just improved the constant folding.
In C++ which has done that constant folding forever we don't warn, because
check_format_arguments is called with the non-folded original arguments
(though, 
before delayed folding - r217814 - C++ warned about this).
Though, for this case I'd think it is a good think to warn about
  const char *const p = NULL;
  printf ("%s\n", p);

My suggestion is if you don't want this warning don't use const on the
variables, it doesn't improve the generated code when optimizing, so the only
advantage of it is making sure you inside of the macro don't try to change the
value of the variables.

Reply via email to