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

            Bug ID: 104289
           Summary: -fdiagnostics-parseable-fixits doesn't always generate
                    fixit notes
           Product: gcc
           Version: 11.2.1
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c
          Assignee: unassigned at gcc dot gnu.org
          Reporter: eric.pouech at orange dot fr
  Target Milestone: ---

[eric]$ cat b2.c
#include <stdio.h>

#define foo(x...) printf(x);

int main(void)
{
    long l = 0;
    foo("this is a"
        "long line: %d\n", l);              
    return 0;
}
[eric]$ LC_ALL=C gcc -Wall -fdiagnostics-parseable-fixits -c b2.c
b2.c: In function 'main':
b2.c:8:9: warning: format '%d' expects argument of type 'int', but argument 2
has type 'long int' [-Wformat=]
    8 |     foo("this is a"
      |         ^~~~~~~~~~~
    9 |         "long line: %d\n", l);
      |                            ~
      |                            |
      |                            long int
b2.c:3:26: note: in definition of macro 'foo'
    3 | #define foo(x...) printf(x);
      |                          ^

I'm expecting a fixit note to be present.
Note: the same snipnet without the multi line string, or the macro work as
expected.

Reply via email to