On Feb 10, 2012, at 11:42 AM, David Blaikie <[email protected]> wrote:
> On Fri, Feb 10, 2012 at 11:13 AM, Ted Kremenek <[email protected]> wrote: >> Author: kremenek >> Date: Fri Feb 10 13:13:51 2012 >> New Revision: 150260 >> >> URL: http://llvm.org/viewvc/llvm-project?rev=150260&view=rev >> Log: >> Enhance checking for null format string literal to take into account __null. >> Fixes <rdar://problem/8269537>. >> >> Modified: >> cfe/trunk/lib/Sema/SemaChecking.cpp >> cfe/trunk/test/SemaCXX/format-strings.cpp >> >> Modified: cfe/trunk/lib/Sema/SemaChecking.cpp >> URL: >> http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/SemaChecking.cpp?rev=150260&r1=150259&r2=150260&view=diff >> ============================================================================== >> --- cfe/trunk/lib/Sema/SemaChecking.cpp (original) >> +++ cfe/trunk/lib/Sema/SemaChecking.cpp Fri Feb 10 13:13:51 2012 >> @@ -1381,6 +1381,7 @@ >> inFunctionCall); >> } >> >> + case Stmt::GNUNullExprClass: >> case Stmt::IntegerLiteralClass: > > could/should this be generalized over all null pointer literals? Absolutely. > > This, for example, still flags 'nullptr' and (to a more questionable > extent) 'false' which is still technically a valid null pointer. If > I'm reading/testing it correctly, that is. It's questionable whether we should be happy with any integer literal, but definitely we should not warn about any cases of null.
_______________________________________________ cfe-commits mailing list [email protected] http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits
