]> granicus.if.org Git - clang/commit
Teach format string checking about compile-time CFString constants.
authorJordan Rose <jordan_rose@apple.com>
Mon, 4 Jun 2012 23:52:23 +0000 (23:52 +0000)
committerJordan Rose <jordan_rose@apple.com>
Mon, 4 Jun 2012 23:52:23 +0000 (23:52 +0000)
commit50687314f87b67073c202fe46d84d12fb55e25cf
tree491dbe2cec61beaa39e868fd028e929b6e396df9
parent033a9c0804f48119a03b73a2af42a04d4d0294ce
Teach format string checking about compile-time CFString constants.

Within the guts of CheckFormatHandler, the IsObjCLiteral flag was being used in
two ways: to see if null bytes were allowed, and to see if the '%@' specifier
is allowed.* The former usage has been changed to an explicit test and the
latter pushed down to CheckPrintfHandler and renamed ObjCContext, since it
applies to CFStrings as well.

* This also changes how wide chars are interpreted; in OS X Foundation, the
wide character type is 'unichar', a typedef for short, rather than wchar_t.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@157968 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Sema/SemaChecking.cpp
test/SemaObjC/format-strings-objc.m