[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

Nick Lewycky nlewycky at google.com
Fri Dec 2 15:15:08 PST 2011


On 2 December 2011 11:22, Hans Wennborg <hans at hanshq.net> wrote:
> Author: hans
> Date: Fri Dec  2 13:22:15 2011
> New Revision: 145697
>
> URL: http://llvm.org/viewvc/llvm-project?rev=145697&view=rev
> Log:
> Make conversion specifier warning refer to typedef if possible.
>
> For example, the warning for printf("%zu", 42.0);
> changes from "conversion specifies type 'unsigned long'" to "conversion
> specifies type 'size_t' (aka 'unsigned long')"
>

> Modified: cfe/trunk/lib/Analysis/PrintfFormatString.cpp
> URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Analysis/PrintfFormatString.cpp?rev=145697&r1=145696&r2=145697&view=diff
> ==============================================================================
> --- cfe/trunk/lib/Analysis/PrintfFormatString.cpp (original)
> +++ cfe/trunk/lib/Analysis/PrintfFormatString.cpp Fri Dec  2 13:22:15 2011
> @@ -13,6 +13,7 @@
>  //===----------------------------------------------------------------------===//
>
>  #include "clang/Analysis/Analyses/FormatString.h"
> +#include "clang/Sema/Sema.h"

Hi Hans,

This introduces a dependency on Sema, which is cyclic because Sema
already depends on Analysis.

I'm going to revert this patch for the time being. Please reapply once
you figure out the dependency (basically, you can use the AST but not
Sema here). You can get an ASTContext from any Decl, which should
solve part of the problem, but I don't know what to do about the name
lookup.

Nick




More information about the cfe-commits mailing list