[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

Hans Wennborg hans at chromium.org
Sat Dec 3 08:24:45 PST 2011


On Fri, Dec 2, 2011 at 11:15 PM, Nick Lewycky <nlewycky at google.com> wrote:
>>  #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.

Hi Nick,

Thanks for reverting; sorry I wasn't around to do it myself.

Is there something within the build system or otherwise that would
allow me to catch the introduction of a bad dependency like this? Or
is it down to manual inspection?

I'm thinking lookup might not be really necessary here. The warning
doesn't really need to find the typedef, it can just refer to e.g.
"size_t" by name. I'll get a new patch out for review next week.

Cheers,
Hans




More information about the cfe-commits mailing list