Don't ignore clang-tidy failures#259
Merged
Merged
Conversation
65176ea to
6fae76b
Compare
serprex
approved these changes
May 28, 2026
Not sure why we had ` || true` after `clang-tidy`, but it caused it to always
pass. Remove it and fix the issue it reports, notably:
* Change `{0}` to `{}` to eliminate "The value '0' provided to the
cast expression is not in the valid range of values for 'xxx'"
warnings.
* Switch from `atoi` to `strtol` to eliminate "'atoi' used to convert
a string to an integer value, but function will not report
conversion errors; consider using 'strtol' instead" warning.
* Protect against dims[level] garbage in flatten_nested_array's recursion
(clang-tidy can't prove level < slot->ndim across recursive calls).
Zero-initialize dims & lbs; worst case benign slot->len != 0 returns false.
* `scratch` oid was uninitialized, so recursive read_value reading *valtype in
CHC_JSON/CHC_OBJECT case tripped garbage-value warning. Set scratch to
slot->item_type as canonical pg OID.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Not sure why we had
|| trueafterclang-tidy, but it caused it to always pass. Remove it and fix the issue it reports, notably:{0}to{}to eliminate "The value '0' provided to the cast expression is not in the valid range of values for 'xxx'" warnings.atoitostrtolto eliminate "'atoi' used to convert a string to an integer value, but function will not report conversion errors; consider using 'strtol' instead" warning.scratchoid was uninitialized, so recursive read_value reading *valtype in CHC_JSON/CHC_OBJECT case tripped garbage-value warning. Set scratch to slot->item_type as canonical pg OID.