http://llvm.org/bugs/show_bug.cgi?id=11152

           Summary: suggest %zu for size_t args to printf, at least in c99
                    mode
           Product: clang
           Version: trunk
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: -New Bugs
        AssignedTo: [email protected]
        ReportedBy: [email protected]
                CC: [email protected]


For the following program:

#include <stdio.h>

void f(size_t a) {
  printf("%c", a);
}

Clang suggests this:

/tmp/a.c:4:12: warning: conversion specifies type 'int' but the argument has
      type 'size_t' (aka 'unsigned long') [-Wformat]
  printf("%c", a);
          ~^   ~
          %lu


It would be better if it suggested %zu, at least in C99 (and C++11).

-- 
Configure bugmail: http://llvm.org/bugs/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.
_______________________________________________
LLVMbugs mailing list
[email protected]
http://lists.cs.uiuc.edu/mailman/listinfo/llvmbugs

Reply via email to