public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c/104289] New: -fdiagnostics-parseable-fixits doesn't always generate fixit notes
@ 2022-01-30 13:06 eric.pouech at orange dot fr
  2022-01-30 20:46 ` [Bug c/104289] " pinskia at gcc dot gnu.org
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: eric.pouech at orange dot fr @ 2022-01-30 13:06 UTC (permalink / raw)
  To: gcc-bugs

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.

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2022-02-02 10:12 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-01-30 13:06 [Bug c/104289] New: -fdiagnostics-parseable-fixits doesn't always generate fixit notes eric.pouech at orange dot fr
2022-01-30 20:46 ` [Bug c/104289] " pinskia at gcc dot gnu.org
2022-01-31 15:08 ` dmalcolm at gcc dot gnu.org
2022-02-02 10:12 ` eric.pouech at orange dot fr

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).