| Commit message (Collapse) | Author | Age | Files | Lines |
... | |
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
- Added warning for undefined behavior when using field specifier
- Added warning for undefined behavior when using length modifier
- Fixed warnings for invalid flags
- Added warning for ignored flags
- Added fixits for the above warnings
- Fixed accuracy of detecting several undefined behavior conditions
- Receive normal warnings in addition to security warnings when using %n
- Fix bug where '+' flag would remain on unsigned conversion suggestions
Summary of changes:
- Added expanded tests
- Added/expanded warnings
- Added position info to OptionalAmounts for fixits
- Extracted optional flags to a wrapper class with position info for fixits
- Added several methods to validate a FormatSpecifier by component, each checking for undefined behavior
- Fixed conversion specifier checking to conform to C99 standard
- Added hooks to detect the invalid states in CheckPrintfHandler::HandleFormatSpecifier
Note: warnings involving the ' ' (space) flag are temporarily disabled until whitespace highlighting no longer triggers assertions. I will make a post about this on cfe-dev shortly.
M test/Sema/format-strings.c
M include/clang/Basic/DiagnosticSemaKinds.td
M include/clang/Analysis/Analyses/PrintfFormatString.h
M lib/Analysis/PrintfFormatString.cpp
M lib/Sema/SemaChecking.cpp
llvm-svn: 106233
|
|
|
|
|
|
| |
PR 4468.
llvm-svn: 106151
|
|
|
|
|
|
|
|
|
|
|
|
| |
- Added some handling of flags that become invalid when changing the conversion specifier.
- Changed fixit behavior to remove unnecessary length modifiers.
- Separated some tests out and added some comments.
modified:
lib/Analysis/PrintfFormatString.cpp
test/Sema/format-strings-fixit.c
llvm-svn: 105807
|
|
|
|
|
|
|
| |
diagnosing this code as an error when it should, so I've filed
http://llvm.org/bugs/show_bug.cgi?id=7325.
llvm-svn: 105683
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
- Refactored LengthModifier to be a class.
- Added toString methods in all member classes of FormatSpecifier.
- FixIt suggestions keep user specified flags unless incorrect.
Limitations:
- The suggestions are not conversion specifier sensitive. For example, if we have a 'pad with zeroes' flag, and the correction is a string conversion specifier, we do not remove the flag. Clang will warn us on the next compilation.
A test/Sema/format-strings-fixit.c
M include/clang/Analysis/Analyses/PrintfFormatString.h
M lib/Analysis/PrintfFormatString.cpp
M lib/Sema/SemaChecking.cpp
llvm-svn: 105680
|
|
|
|
| |
llvm-svn: 99479
|
|
|
|
|
|
| |
Fixes <rdar://problem/7700339>.
llvm-svn: 97482
|
|
|
|
|
|
| |
Along the way, coelesce some of the diagnostics.
llvm-svn: 97297
|
|
|
|
|
|
|
|
|
| |
index out of
Sema and into analyze_printf::ParseFormatString(). Also use a bitvector to determine
what arguments have been covered (instead of just checking to see if the last argument consumed is the max argument). This is prep. for support positional arguments (an IEEE extension).
llvm-svn: 97248
|
|
|
|
| |
llvm-svn: 97005
|
|
|
|
|
|
|
|
|
|
| |
analyze_printf::ArgTypeResult.
Implement printf argument type checking for '%s'.
Fixes <rdar://problem/3065808>.
llvm-svn: 96310
|
|
|
|
| |
llvm-svn: 95621
|
|
|
|
|
|
| |
analyze_printf namespace.
llvm-svn: 95324
|
|
|
|
| |
llvm-svn: 95026
|
|
|
|
| |
llvm-svn: 94894
|
|
|
|
|
|
| |
<rdar://problem/6931734>.
llvm-svn: 94867
|
|
|
|
| |
llvm-svn: 94852
|
|
|
|
|
|
| |
that returns the expected type of the matching data argument. It isn't complete, but should handle several of the important cases.
llvm-svn: 94851
|
|
|
|
|
|
|
|
|
|
| |
- Add ConversionSpecifier::consumesDataArgument() as a helper method
to determine if a conversion specifier requires a matching argument.
- Add support for glibc-specific '%m' conversion
- Add an extra callback to HandleNull() for locations within the
format specifier that have a null character
llvm-svn: 94834
|
|
|
|
|
|
|
|
|
|
| |
specifiers.
In addition, move ParseFormatString() and FormatStringHandler() from
the clang::analyze_printf to the clang namespace. Hopefully this will
resolve some link errors on Linux.
llvm-svn: 94794
|
|
|
|
|
|
| |
specifiers.
llvm-svn: 94792
|
|
|
|
|
|
| |
differences on how nested namespaces are handled...
llvm-svn: 94790
|
|
|
|
|
|
| |
namespace directives. Hopefully this will make the Linux buildbots happy.
llvm-svn: 94784
|
|
|
|
| |
llvm-svn: 94774
|
|
|
|
|
|
| |
of a null character.
llvm-svn: 94762
|
|
|
|
| |
llvm-svn: 94739
|
|
|
|
|
|
| |
where the reference to 'printf' is ambiguous.
llvm-svn: 94733
|
|
|
|
|
|
| |
format string is desired.
llvm-svn: 94715
|
|
|
|
| |
llvm-svn: 94713
|
|
|
|
| |
llvm-svn: 94707
|
|
|
|
|
|
| |
in SemaChecking).
llvm-svn: 94704
|
|
strings than what we currently have in Sema. This is both an
experiment and a WIP.
The idea is simple: parse the format string incrementally,
constructing a well-structure representation of each format specifier.
Each format specifier is then handed back one-by-one to a client via a
callback. Malformed format strings are also handled with callbacks.
The idea is to separate the parsing of the format string from the
emission of diagnostics. Currently what we have in Sema for handling
format strings is a mongrel of both that is hard to follow and
difficult to modify (I can apply this label since I'm the original
author of that code).
This is in libAnalysis as it is reasonable generic and can potentially
be used both by libSema and libChecker.
Comments welcome.
llvm-svn: 94702
|