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

Martin Sebor <msebor at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |msebor at gcc dot gnu.org

--- Comment #7 from Martin Sebor <msebor at gcc dot gnu.org> ---
GCC format strings can contain directives like %< and %> that trigger special
handling (such as quoting and highlighting).  For example, in
gcc/c-family/c-common.c:

    message = catenate_messages (gmsgid, " before %<#pragma%>");
    ...
  if (message)
    {
      error (message);
      free (message);

error message ends up quoting #pragma and displaying it in the color set by
quote= in GCC_COLORS:

https://gcc.gnu.org/onlinedocs/gcc/Diagnostic-Message-Formatting-Options.html

To do what you suggest I think GCC would need to recognize and use a special
directive telling to treat its argument as a format string (i.e., implement at
least a limited form recursive format string handling).

Reply via email to