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

            Bug ID: 71360
           Summary: Wrong position for "warning: '0' flag ignored with
                    precision and ‘%d’ gnu_printf format [-Wformat=]"
           Product: gcc
           Version: 7.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c
          Assignee: unassigned at gcc dot gnu.org
          Reporter: ch3root at openwall dot com
  Target Milestone: ---

Source code:

----------------------------------------------------------------------
#include <stdio.h>

int main()
{
  printf("abc" "%05.3d\n", 1);
}
----------------------------------------------------------------------

Results:

----------------------------------------------------------------------
$ gcc -std=c11 -pedantic -Wall -Wextra -O3 test.c && ./a.out
test.c: In function ‘main’:
test.c:5:10: warning: '0' flag ignored with precision and ‘%d’ gnu_printf
format [-Wformat=]
   printf("abc" "%05.3d\n", 1);
          ^~~~~
abc  001
----------------------------------------------------------------------

gcc version: gcc (GCC) 7.0.0 20160531 (experimental)

This is split from https://gcc.gnu.org/bugzilla/show_bug.cgi?id=70924 as it
seems to be a separate issue.

Reply via email to