Skip to content

Commit

Permalink
Fix error: comparison of unsigned expression in ‘< 0’ is always false…
Browse files Browse the repository at this point in the history
… [-Werror=type-limits]

Summary:
Fix OSS build failure: https://github.com/facebookincubator/velox/actions/runs/9354921916/job/25748893926

```
/home/runner/work/velox/velox/velox/./velox/functions/prestosql/SIMDJsonFunctions.h:192:36: error: comparison of unsigned expression in ‘< 0’ is always false [-Werror=type-limits]
  192 |     } else if (numElements + index < 0) {
      |                ~~~~~~~~~~~~~~~~~~~~^~~
cc1plus: all warnings being treated as errors
```

Reviewed By: Yuhta

Differential Revision: D58100041

fbshipit-source-id: 139abaf74e901bcbe9aa7ea6096067d314e4d7b2
  • Loading branch information
mbasmanova authored and facebook-github-bot committed Jun 3, 2024
1 parent c50a117 commit 61c3379
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion velox/functions/prestosql/SIMDJsonFunctions.h
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,7 @@ struct SIMDJsonArrayGetFunction {
if (index >= numElements) {
return false;
}
} else if (numElements + index < 0) {
} else if ((int64_t)numElements + index < 0) {
return false;
} else {
index += numElements;
Expand Down

0 comments on commit 61c3379

Please sign in to comment.