Skip to content
This repository has been archived by the owner on Nov 6, 2022. It is now read-only.

Fix -Wsign-compare warning. #515

Merged
merged 1 commit into from
May 15, 2020
Merged

Fix -Wsign-compare warning. #515

merged 1 commit into from
May 15, 2020

Conversation

bnoordhuis
Copy link
Member

The operands to + are promoted from uint16_t to int before
addition, making the expression off + len <= buflen emit a
warning because buflen is unsigned.

Fixes: #514

Copy link
Member

@indutny indutny left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

The operands to `+` are promoted from `uint16_t` to `int` before
addition, making the expression `off + len <= buflen` emit a
warning because `buflen` is unsigned.

Fixes: nodejs#514
PR-URL: nodejs#515
Reviewed-By: Fedor Indutny <[email protected]>
@bnoordhuis bnoordhuis merged commit d9275da into nodejs:master May 15, 2020
@bnoordhuis bnoordhuis deleted the fix514 branch May 15, 2020 11:30
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Fix -Wsign-compare warning
2 participants