[cfe-commits] r145697 - in /cfe/trunk: include/clang/Analysis/Analyses/FormatString.h lib/Analysis/FormatString.cpp lib/Analysis/PrintfFormatString.cpp lib/Sema/SemaChecking.cpp test/Sema/format-strings-int-typedefs.c

Joerg Sonnenberger joerg at britannica.bec.de
Sun Dec 4 08:54:33 PST 2011


On Sat, Dec 03, 2011 at 08:55:43PM -0800, John McCall wrote:
> On Dec 3, 2011, at 1:37 PM, Joerg Sonnenberger wrote:
> > On Sat, Dec 03, 2011 at 10:14:24AM -0800, Douglas Gregor wrote:
> >> The warning does need to find the typedef, because it shouldn't suggest
> >> 'size_t' if no 'size_t' is visible. However, you can just perform
> >> lookup into the translation unit (using DeclContext's lookup) to find
> >> an appropriately-typed 'size_t' typedef.
> > 
> > I disagree on this. %zu should *always* suggest size_t, %ju should
> > *always* suggest uintmax_t etc.
> 
> I agree, although I also agree that suggesting a type not in scope is
> not great.  We could check for the type and suggest the C99 header to
> #include if it's not present, though.

Sounds good.

Joerg



More information about the cfe-commits mailing list