[Bug preprocessor/104147] [9/10/11/12 Regression] C preprocessor may remove the standard required whitespace between the preprocessing tokens

jakub at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Mon Jan 31 14:50:28 GMT 2022


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

--- Comment #3 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
Looking at the PREV_WHITE uses, they look like:
  if (token->type == CPP_PADDING)
    {
      avoid_paste = true;
      if (print.source == NULL
          || (!(print.source->flags & PREV_WHITE)
              && token->val.source == NULL))
        print.source = token->val.source;
      return;
    }
...
  if (avoid_paste)
    {
...
      else if (print.source->flags & PREV_WHITE
...
    }
  else if (token->flags & PREV_WHITE)

and stringify_arg has something similar.
So, makes me wonder if funlike_invocation_p isn't just a copy & paste
of those conditions, with the important difference that padding (what we
remember) is not the source, but the token itself.
I'd expect something like:
      if (padding == NULL
          || padding->val.source == NULL
          || (!(padding->val.source->flags & PREV_WHITE)
              && token->val.source == NULL))
        padding = token;
instead.


More information about the Gcc-bugs mailing list