Skip to content

Fix narrowing conversion error #3

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Conversation

jmr
Copy link

@jmr jmr commented Apr 25, 2022

Fixes #2.

Explicitly cast values to DTsucc to avoid error:

static/suffixtree/RMQ_succinct.cpp:115:85: error: narrowing conversion of ‘-1’ from ‘int’ to ‘DTsucc {aka unsigned char}’ inside { } [-Wnarrowing]
  const DTsucc RMQ_succinct::HighestBitsSet[8] = {~0, ~1, ~3, ~7, ~15, ~31, ~63, ~127};

This appears to be an error in C++11 and newer, which is typically
the default mode these days.

Fixes migumar2#2.

Explicitly cast values to `DTsucc` to avoid error:
```
static/suffixtree/RMQ_succinct.cpp:115:85: error: narrowing conversion of ‘-1’ from ‘int’ to ‘DTsucc {aka unsigned char}’ inside { } [-Wnarrowing]
  const DTsucc RMQ_succinct::HighestBitsSet[8] = {~0, ~1, ~3, ~7, ~15, ~31, ~63, ~127};
```

This appears to be an error in C++11 and newer, which is typically
the default mode these days.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Problems compiling the libcds
1 participant