It doesn’t seem ideal to have an integer sanitizer enabled, but then disable it for the whole validation.cpp file.
This removes one of the two violations.
This should be a refactor.
It doesn’t seem ideal to have an integer sanitizer enabled, but then disable it for the whole validation.cpp file.
This removes one of the two violations.
This should be a refactor.
I’ve pushed a new version, which:
Code Review ACK https://github.com/bitcoin/bitcoin/pull/24227/commits/fadcd031390dd4588bbb1c07e5020a7131312050
Tried running below code to confirm:
0 uint64_t i = 4;
1 while (--i)
2 {
3 cout<<i;
4 }
5 cout<<i;
6
0 uint64_t i = 4;
1 while (i--)
2 {
3 cout<<i;
4 }
5 cout<<i;
6
0 uint64_t i = 4;
1 while (i)
2 {
3 --i;
4 cout<<i;
5 }
6 cout<<i;
7
It is also according to coding style mentioned in docs: https://github.com/bitcoin/bitcoin/blob/master/doc/developer-notes.md#coding-style-c
unsigned-integer-overflow
, which is why I picked the title.
No idea, but the suppression is called
unsigned-integer-overflow
, which is why I picked the title.
I presume there are more unsigned-integer-overflow
in validation.cpp preventing you from removing the suppression?
Have you seen the pull request you commented on? #24196 (review)
Ahh, thanks, I forgot they were related / about that PR