| Commit message (Collapse) | Author | Age | Files | Lines |
... | |
|
|
|
| |
llvm-svn: 157716
|
|
|
|
|
|
|
|
|
| |
This is in preparation for being able to warn about 'q' and other
non-standard format string features.
It also allows us to print its name correctly.
llvm-svn: 150697
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This commit makes PrintfSpecifier::fixType() and ScanfSpecifier::fixType()
only fix a conversion specification enough that Clang wouldn't warn about it,
as opposed to always changing it to use the "canonical" conversion specifier.
(PR11975)
This preserves the user's choice of conversion specifier in cases like:
printf("%a", (long double)1);
where we previously suggested "%Lf", we now suggest "%La"
printf("%x", (long)1);
where we previously suggested "%ld", we now suggest "%lx".
llvm-svn: 150578
|
|
|
|
|
|
| |
As discussed at http://lists.cs.uiuc.edu/pipermail/cfe-commits/Week-of-Mon-20120130/052200.html
llvm-svn: 149325
|
|
|
|
| |
llvm-svn: 148885
|
|
|
|
|
|
| |
Fixes PR 9466.
llvm-svn: 148859
|
|
|
|
|
|
| |
are used with that and the 'a' length modifier.
llvm-svn: 148029
|
|
|
|
|
|
|
|
|
| |
extension.
This fixes gcc.dg/format/c90-scanf-3.c and ext-4.c (test for excess
errors).
llvm-svn: 146649
|
|
|
|
| |
llvm-svn: 146259
|
|
|
|
|
|
| |
in addition to underlying type.
llvm-svn: 146254
|
|
|
|
|
|
|
| |
It's declared in FormatString.h, so it shouldn't be defined in
PrintfFormatString.cpp.
llvm-svn: 146253
|
|
|
|
|
|
| |
It should reset the length modifier (unless it's a wchar_t string).
llvm-svn: 146252
|
|
|
|
|
|
|
|
|
|
|
|
| |
in addition to underlying type.
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')"
(This is a second attempt after r145697, which got reverted.)
llvm-svn: 146032
|
|
|
|
|
|
| |
lib/Analysis to lib/Sema which is cyclical.
llvm-svn: 145724
|
|
|
|
|
|
| |
Use the canonical type of the typedef to compare with the underlying type.
llvm-svn: 145702
|
|
|
|
|
|
|
|
| |
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')"
llvm-svn: 145697
|
|
|
|
|
|
|
|
| |
The code had it backwards, thinking size_t was signed, and using that for "%zd".
Also let the analysis get the types for (u)intmax_t while we are at it.
llvm-svn: 143099
|
|
|
|
|
|
| |
accept any char, not just signed char. Fixes <rdar://problem/10303638>.
llvm-svn: 142908
|
|
|
|
| |
llvm-svn: 142433
|
|
|
|
|
|
|
|
| |
For PR11152. Make PrintSpecifier::fixType() suggest "%zu" for size_t, etc.
rather than looking at the underlying type and suggesting "%llu" or other
platform-specific length modifiers. Applies to C99 and C++11.
llvm-svn: 142342
|
|
|
|
|
|
|
|
| |
casts in ARC.
No semantic analysis yet.
llvm-svn: 142208
|
|
|
|
|
|
| |
Lack of half FP was a regression compared to llvm-gcc.
llvm-svn: 142016
|
|
|
|
| |
llvm-svn: 140367
|
|
|
|
| |
llvm-svn: 137896
|
|
|
|
|
|
|
|
| |
LLVM.h imports
them into the clang namespace.
llvm-svn: 135852
|
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
|
|
|
|
| |
actually fix the warning. PR8781.
I'm not sure what the preferred way to write a test for whether a fixit is emitted.
llvm-svn: 130335
|
|
|
|
|
|
| |
integers (e.g., 'x', 'o').
llvm-svn: 130164
|
|
|
|
| |
llvm-svn: 124364
|
|
|
|
| |
llvm-svn: 124363
|
|
|
|
|
|
|
| |
prefix in a printf format string is matched
with the appropriate conversion specifier.
llvm-svn: 123055
|
|
|
|
|
|
| |
prefix to format conversions (POSIX extension).
llvm-svn: 123054
|
|
|
|
|
|
|
| |
16-bits in size. Implement this by splitting WChar into two enums, like we have
for char. This fixes a miscompmilation of XULRunner, PR8856.
llvm-svn: 122558
|
|
|
|
| |
llvm-svn: 120735
|
|
|
|
| |
llvm-svn: 119946
|
|
|
|
|
|
|
|
|
|
| |
it was really a 'char'
or a 'short'. This fixes that and allows the hints to suggest 'h' modifiers for small ints.
Patch by Justin Bogner!
llvm-svn: 116996
|
|
|
|
|
|
| |
compatible argument). Fixes PR 7981.
llvm-svn: 111978
|
|
|
|
| |
llvm-svn: 108906
|
|
|
|
| |
llvm-svn: 108905
|
|
|
|
|
|
|
| |
derived 'PrintfConversionSpecifier' from this class. We will do the same for
'ScanfConversionSpecifier'.
llvm-svn: 108903
|
|
|
|
| |
llvm-svn: 108901
|
|
|
|
|
|
| |
printf checking).
llvm-svn: 108900
|
|
|
|
| |
llvm-svn: 108899
|
|
|
|
|
|
| |
enum for scanf checking.
llvm-svn: 108898
|
|
|
|
|
|
|
| |
analagous enum in analyze_scanf. This is prep for refactoring the logic for handling
ConversionSpecifiers for both scanf and printf.
llvm-svn: 108897
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
includes
handling the parsing of scanf format strings and hooking the checking into Sema.
Most of this checking logic piggybacks on what was already there for checking printf format
strings, but the checking logic has been refactored to support both.
What is left to be done is to support argument type checking in format strings and of course
fix the usual tail of bugs that will follow.
llvm-svn: 108500
|
|
|
|
|
|
|
|
|
| |
types, updating callers of both isFloatingType() and
isRealFloatingType() accordingly. Caught at least one issue where we
allowed one to declare a vector of vectors (!), along with cleaning up
the standard-conversion logic for C++.
llvm-svn: 106595
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
- Precision toStrings shouldn't print a dot when they have no value.
- Length of char length modifier is now returned correctly.
- Added several fixit tests.
Note: fixit tests are currently broken due to a bug in HighlightRange. Marking as XFAIL for now.
M test/Sema/format-strings-fixit.c
M include/clang/Analysis/Analyses/PrintfFormatString.h
M lib/Analysis/PrintfFormatString.cpp
llvm-svn: 106275
|
|
|
|
|
|
|
| |
M include/clang/Analysis/Analyses/PrintfFormatString.h
M lib/Analysis/PrintfFormatString.cpp
llvm-svn: 106245
|