This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug c/53946] New: gcc emits warning when intmax_t is long long and format string %jd is used


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=53946

             Bug #: 53946
           Summary: gcc emits warning when intmax_t is long long and
                    format string %jd is used
    Classification: Unclassified
           Product: gcc
           Version: 4.5.3
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c
        AssignedTo: unassigned@gcc.gnu.org
        ReportedBy: lxllol@yopmail.com


/* compile with -Wall -Werror */

typedef long long intmax_t;
#include <stdio.h>
int main() {
        char x = 42;
        printf("%jd\n", (intmax_t) x);
        return 0;
}


$ gcc t.c -Wall -Werror
cc1: warnings being treated as errors
t.c: In function âmainâ:
t.c:7:2: error: format â%jdâ expects type âintmax_tâ, but argument 2 has type
âlong long intâ


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]