Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ where
or
exists(Variable var |
var = element and
not var.isCompilerGenerated() and
var.getType() instanceof LeapYearUnsafeDaysOfTheYearArrayType and
allocType = "an array allocation"
)
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
---
category: minorAnalysis
---
* The `cpp/leap-year/unsafe-array-for-days-of-the-year` query ("Unsafe array for days of the year") no longer reports an alert on the `__PRETTY_FUNCTION__` variable (and related variables) when the enclosing function has a signature that is exactly 364 characters.
Original file line number Diff line number Diff line change
Expand Up @@ -68,3 +68,12 @@ void VectorOfDays_FalsePositive(int dayOfYear, int x)

items[dayOfYear - 1] = x;
}

void f_______________________________________________________this_name_must_be_exactly_357_chars__________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________() {
// Using this magic compiler variable results in a `const char` array being
// initialized with the function signature. Including `void`, a space, and
// `()`, the signature adds up to exactly 364 characters in this case.
// The initializer for `__PRETTY_FUNCTION__` thus initializes an array of
// length 365 (because the null-terminator adds another character).
auto x = __PRETTY_FUNCTION__; // clean
}
Loading