Join GitHub today
GitHub is home to over 20 million developers working together to host and review code, manage projects, and build software together.
Avoid static analyzer warnings regarding uninitialized arguments #10735
Conversation
| - 17, 79, 8, 99, 150, 189, 208, 162, 22, 23, 203, 163, 36, 58, 147, | ||
| - 227, 139, 2, 215, 100, 91, 38, 11, 141, 253, 40, 117, 21, 16, 90, | ||
| - 200, 24 | ||
| + std::array<unsigned char, 32> buff = { |
TheBlueMatt
Jul 14, 2017
Contributor
tiny nit: I might prefer this if it kept the benchmarked-against data on stack instead of heap, but it doesnt matter much.
sipa
Jul 15, 2017
Owner
@TheBlueMatt static const is just statically allocated by the binary, not even on the heap.
TheBlueMatt
Jul 15, 2017
Contributor
Yes, indeed, my point was to prefer stack over binary or other allocations. It shouldnt matter cause the memory usage of these benchmarks should be trivial, so whatever, it doesnt matter.
fanquake
added the
Refactoring
label
Jul 5, 2017
|
utACK dcc0e0f |
|
OS X, Apple LLVM version 7.0.2:
|
|
@paveljanik Missing |
|
utACK 6835cb0 |
|
utACK 6835cb0 |
|
utACK 6835cb0 |
sipa
merged commit 6835cb0
into
bitcoin:master
Jul 16, 2017
1 check passed
continuous-integration/travis-ci/pr
The Travis CI build passed
Details
sipa
added a commit
that referenced
this pull request
Jul 16, 2017
|
|
sipa |
5654946
|
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
practicalswift commentedJul 3, 2017
•
edited
Avoid static analyzer warnings regarding "Function call argument is a pointer to uninitialized value" in cases where we are intentionally using such arguments.
This is achieved by using
f(b.begin(), b.end())(std::array<char, N>) instead off(b, b + N)(char b[N]).Rationale:
Before this commit:
After this commit: