| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
|
|
|
|
| |
"consuming data arguments"
Reviewers: rsmith, bruno, dexonsmith
Subscribers: cfe-commits
Differential Revision: https://reviews.llvm.org/D27796
llvm-svn: 289850
|
|
|
|
|
|
|
|
|
|
|
|
| |
This commit improves the '-Wformat' warnings by ensuring that the formatting
checker can see through Objective-C message sends when we are calling an
Objective-C method with an appropriate format_arg attribute.
rdar://23622446
Differential Revision: https://reviews.llvm.org/D25820
llvm-svn: 284961
|
|
|
|
|
|
|
|
|
|
| |
Followup from r264752.
Attempt to appease buildbots:
http://lab.llvm.org:8011/builders/clang-ppc64be-linux/builds/2882
http://lab.llvm.org:8011/builders/clang-s390x-linux/builds/2619
llvm-svn: 264765
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Improve invalid format string specifier handling by printing out
invalid specifiers characters with \x, \u and \U. Previously clang
would print gargabe whenever the character is unprintable.
Example, before:
NSLog(@"%\u25B9"); => warning: invalid conversion specifier ' [-Wformat-invalid-specifier]
after:
NSLog(@"%\u25B9"); => warning: invalid conversion specifier '\u25b9' [-Wformat-invalid-specifier]
Differential Revision: http://reviews.llvm.org/D18296
rdar://problem/24672159
llvm-svn: 264752
|
|
|
|
|
|
|
|
| |
r263299 added a fixit for the -Wformat-security warning, but that runs
into complications with our guideline that error recovery should be done
as-if the fixit had been applied. Putting the fixit on a note avoids that.
llvm-svn: 263584
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Objective-C format strings now support modifier flags
that can be attached to a '@' conversion. Currently
the only one supported, as of iOS 9 and OS X 10.11,
is the new "technical term", denoted by the flag "tt",
for example:
%[tt]@
instead of just:
%@
The 'tt' stands for "technical term", which is used
by the string-localization facilities on Darwin to
add the appropriate spacing or quotation depending
the language locale.
Implements <rdar://problem/20374720>.
llvm-svn: 241243
|
|
|
|
|
|
| |
for a typedef before arithmetic conversion in all rare corner cases.
llvm-svn: 222049
|
|
|
|
|
|
| |
with objc stuff will be resolved.
llvm-svn: 221829
|
|
|
|
| |
llvm-svn: 221824
|
|
|
|
|
|
|
|
| |
Also assert that we never create non-array string literals again.
PR18939.
llvm-svn: 202147
|
|
|
|
|
|
|
|
| |
that can represent unicode characters
Fixes <rdar://problem/13991617>.
llvm-svn: 192673
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
function: it can't be 'void' and it can't be an initializer list. We give a
hard error for these rather than treating them as undefined behavior (we can
and probably should do the same for non-POD types in C++11, but as of this
change we don't).
Slightly rework the checking of variadic arguments in a function with a format
attribute to ensure that certain kinds of format string problem (non-literal
string, too many/too few arguments, ...) don't suppress this error.
llvm-svn: 187735
|
|
|
|
|
|
|
|
| |
Yes, this came from actual code.
Fixes <rdar://problem/13557053>.
llvm-svn: 179155
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
For most cases where a conversion specifier doesn't match an argument,
we usually guess that the conversion specifier is wrong. However, if
the argument is an integer type and the specifier is %C, it's likely
the user really did mean to print the integer as a character.
(This is more common than %c because there is no way to specify a unichar
literal -- you have to write an integer literal, such as '0x2603',
and then cast it to unichar.)
This does not change the behavior of %S, since there are fewer cases
where printing a literal Unicode *string* is necessary, but this could
easily be changed in the future.
<rdar://problem/11982013>
llvm-svn: 169400
|
|
|
|
|
|
|
|
|
| |
We handled the builtin version of this function in r157968, but the builtin
isn't used when compiling as -fno-constant-cfstrings.
This should complete <rdar://problem/6157200>.
llvm-svn: 161525
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
While we still want to consider this a hard error (non-POD variadic args are
normally a DefaultError warning), delaying the diagnostic allows us to give
better error messages, which also match the usual non-POD errors more closely.
In addition, this change improves the diagnostic messages for format string
argument type mismatches by passing down the type of the callee, so we can
say "variadic method" or "variadic function" appropriately.
<rdar://problem/11825593>
llvm-svn: 160517
|
|
|
|
|
|
| |
No functionality change.
llvm-svn: 160516
|
|
|
|
|
|
|
|
|
| |
Previously, we would ask for the SourceLocation of an argument even if
it were NULL (i.e. if Sema resulted in an ExprError trying to build it).
<rdar://problem/11890818>
llvm-svn: 160515
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.
llvm-svn: 157968
|
|
|
|
|
|
| |
Add a test case for the related NSAssert workaround.
llvm-svn: 156205
|
|
|
|
|
|
|
|
|
| |
root class is intentionally declared.
The warning this inhibits, -Wobjc-root-class, is opt-in for now. However, all clang unit tests that would trigger
the warning have been updated to use -Wno-objc-root-class. <rdar://problem/7446698>
llvm-svn: 154187
|
|
|
|
| |
llvm-svn: 152839
|
|
|
|
|
|
| |
warn if the format string argument is a parameter that is not itself declared as a format string with compatible format.
llvm-svn: 151080
|
|
|
|
|
|
| |
<rdar://problem/10814120>
llvm-svn: 149907
|
|
|
|
|
|
| |
by adding a triple, and the typedef makes things worse on windows.
llvm-svn: 149740
|
|
|
|
|
|
| |
Idea by Jean-Daniel Dupas.
llvm-svn: 149721
|
|
|
|
|
|
| |
windows hosts.
llvm-svn: 149696
|
|
|
|
|
|
| |
As discussed at http://lists.cs.uiuc.edu/pipermail/cfe-commits/Week-of-Mon-20120130/052200.html
llvm-svn: 149325
|
|
|
|
|
|
|
|
|
| |
expansion.
This is to prevent diagnostic when using NSLocalizedString or CFCopyLocalizedString
macros which are usually used in place of NS and CF strings literals.
llvm-svn: 149268
|
|
|
|
|
|
|
| |
- Remove the printf0 special handling as we treat it as printf anyway.
- Perform basic checks (non-literal, empty) for all formats and not only printf/scanf.
llvm-svn: 149236
|
|
|
|
| |
llvm-svn: 148948
|
|
|
|
| |
llvm-svn: 148885
|
|
|
|
|
|
| |
to GCC's).
llvm-svn: 148579
|
|
|
|
|
|
|
| |
PR 10274: format function attribute with the NSString archetype yields no compiler warnings
PR 10275: format function attribute isn't checked in Objective-C methods
llvm-svn: 148324
|
|
|
|
|
|
|
|
|
| |
specifiers. Fixes <rdar://problem/9607158>." because it causes false positives
on some code that uses CF toll free bridging.
- I'll let Doug or Ted figure out the right fix here, possibly just to accept
any pointer type.
llvm-svn: 134041
|
|
|
|
|
|
| |
<rdar://problem/9607158>.
llvm-svn: 133024
|
|
|
|
|
|
| |
PR 4468.
llvm-svn: 106151
|
|
|
|
|
|
| |
doing printf format string checking. This is a recent regression.
llvm-svn: 97318
|
|
|
|
| |
llvm-svn: 94865
|
|
|
|
|
|
|
|
|
| |
checking. It passes all existing tests, and the diagnostics have been
refined to provide better range information (we now highlight
individual format specifiers) and more precise wording in the
diagnostics.
llvm-svn: 94837
|
|
|
|
|
|
|
|
|
| |
- This is designed to make it obvious that %clang_cc1 is a "test variable"
which is substituted. It is '%clang_cc1' instead of '%clang -cc1' because it
can be useful to redefine what gets run as 'clang -cc1' (for example, to set
a default target).
llvm-svn: 91446
|
|
|
|
| |
llvm-svn: 91297
|
|
|
|
|
|
| |
Tests and drivers updated, still need to shuffle dirs.
llvm-svn: 67602
|
|
|
|
| |
llvm-svn: 56639
|
|
remove the objc- prefix from the tests that use it.
llvm-svn: 54084
|