[Clang-tidy] Narrowing data types is implementation defined
Open
Nobody has claimed this yet.
- Dominant language
- C
- Stars
- 2k
- Forks
- 691
- Avg merge
- 1d 16h
- Merged PRs (30d)
- 1
Description
Clang-Tidy: Narrowing conversion from 'unsigned char' to signed type 'char' is implementation-defined
const unsigned char *eol;
S_is_line_end_char(*eol)
where S_is_line_end_char is defined as:
static CMARK_INLINE bool S_is_line_end_char(char c) {
return (c == '\n' || c == '\r');
}
I'm sending a PR to fix it as well.
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start from the shown call to S_is_line_end_char and its definition, then inspect how the unsigned char value is passed to the char parameter. Done means the implementation-defined narrowing warning is resolved without changing line-ending behavior; run the project's existing checks afterward.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- c
- Domain
- tooling
- Issue type
- Bug
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100