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

            Bug ID: 92292
           Summary: duplicate -Wformat warnings about incorrect printf
                    format specifiers
           Product: gcc
           Version: 10.0
            Status: UNCONFIRMED
          Keywords: diagnostic
          Severity: normal
          Priority: P3
         Component: c
          Assignee: unassigned at gcc dot gnu.org
          Reporter: redi at gcc dot gnu.org
  Target Milestone: ---
            Target: *-w64-mingw32

Using mingw-w64 the following program gives two warnings. On other target it
only gives one:

#include <stdio.h>

int main(void)
{

    printf("%lu\n", (long long unsigned)3);

    return 0;
}


p.c: In function 'main':
p.c:6:15: warning: format '%lu' expects argument of type 'long unsigned int',
but argument 2 has type 'long long unsigned int' [-Wformat=]
    6 |     printf("%lu\n", (long long unsigned)3);
      |             ~~^     ~~~~~~~~~~~~~~~~~~~~~
      |               |     |
      |               |     long long unsigned int
      |               long unsigned int
      |             %I64u
p.c:6:15: warning: format '%lu' expects argument of type 'long unsigned int',
but argument 2 has type 'long long unsigned int' [-Wformat=]
    6 |     printf("%lu\n", (long long unsigned)3);
      |             ~~^     ~~~~~~~~~~~~~~~~~~~~~
      |               |     |
      |               |     long long unsigned int
      |               long unsigned int
      |             %I64u

Reply via email to