-
-
Notifications
You must be signed in to change notification settings - Fork 33.3k
Closed
Labels
c++Issues and PRs that require attention from people who are familiar with C++.Issues and PRs that require attention from people who are familiar with C++.
Description
On Windows with MSVC, the implementation of StringSearch<Char>::BoyerMooreHorspoolSearch
emits a concerning warning.
Code:
Lines 459 to 461 in fd02dac
const size_t pattern_length = pattern_.length(); | |
int* char_occurrences = bad_char_shift_table_; | |
int64_t badness = -pattern_length; |
The emitted warning is C4146: unary minus operator applied to unsigned type, result still unsigned
This looks like it introduces a bug in the function, at least on Windows, because badness
is never going to be a negative number.
gengjiawen
Metadata
Metadata
Assignees
Labels
c++Issues and PRs that require attention from people who are familiar with C++.Issues and PRs that require attention from people who are familiar with C++.