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

            Bug ID: 64223
           Summary: same warning repeated twice with same line number
           Product: gcc
           Version: unknown
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: pending
          Assignee: unassigned at gcc dot gnu.org
          Reporter: jg at jguk dot org

gcc (GCC) 4.8.3

Observation:
gcc C compilation outputs same warning twice. Same file and line number

Expectation:
The warning would only be reported once.


$ gcc -Wall -o strstr gcc_warn.c
gcc_warn.c: In function ‘main’:
gcc_warn.c:12:5: warning: format ‘%d’ expects argument of type ‘int’, but
argument 2 has type ‘off_t’ [-Wformat=]
     printf("stat: %d\n", statbuf.st_size);
     ^
gcc_warn.c:12:5: warning: format ‘%d’ expects argument of type ‘int’, but
argument 2 has type ‘off_t’ [-Wformat=]


cat gcc_warn.c

#include <stdio.h>
#include <string.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <unistd.h>

int main(void)
{
    struct stat statbuf;

    printf("stat: %d\n", statbuf.st_size);

    return 0;
}

Reply via email to