kpumuk opened a new pull request, #3387:
URL: https://github.com/apache/thrift/pull/3387
<!-- Explain the changes in the pull request below: -->
Introduce `cppcheck` SCA for the Ruby native extension under `lib/rb/ext`
and fix the existing findings so it can run in CI without noise.
Offenses addressed:
```
lib/rb/ext/compact_protocol.c:128:24: error: Shifting signed 32-bit value by
31 bits is undefined behaviour [shiftTooManyBitsSigned]
return (n << 1) ^ (n >> 31);
^
lib/rb/ext/compact_protocol.c:132:24: error: Shifting signed 64-bit value by
63 bits is undefined behaviour [shiftTooManyBitsSigned]
return (n << 1) ^ (n >> 63);
^
lib/rb/ext/compact_protocol.c:427:33: error: Signed integer overflow for
expression '-(n&1)'. [integerOverflow]
return (((uint32_t)n) >> 1) ^ -(n & 1);
^
lib/rb/ext/struct.c:255:11: style: The scope of the variable 'key' can be
reduced. [variableScope]
VALUE key;
^
lib/rb/ext/struct.c:256:11: style: The scope of the variable 'val' can be
reduced. [variableScope]
VALUE val;
^
lib/rb/ext/struct.c:492:9: style: The scope of the variable 'i' can be
reduced. [variableScope]
int i;
^
lib/rb/ext/struct.c:531:9: style: The scope of the variable 'i' can be
reduced. [variableScope]
int i;
^
lib/rb/ext/struct.c:558:9: style: The scope of the variable 'i' can be
reduced. [variableScope]
int i;
^
lib/rb/ext/thrift_native.c:124:0: style: The function 'Init_thrift_native'
is never used. [unusedFunction]
RUBY_FUNC_EXPORTED void Init_thrift_native(void) {
^
```
<!-- We recommend you review the checklist/tips before submitting a pull
request. -->
- [x] Did you create an [Apache
Jira](https://issues.apache.org/jira/projects/THRIFT/issues/) ticket?
[THRIFT-5941](https://issues.apache.org/jira/browse/THRIFT-5941)
- [x] If a ticket exists: Does your pull request title follow the pattern
"THRIFT-NNNN: describe my issue"?
- [x] Did you squash your changes to a single commit? (not required, but
preferred)
- [x] Did you do your best to avoid breaking changes? If one was needed,
did you label the Jira ticket with "Breaking-Change"?
- [ ] If your change does not involve any code, include `[skip ci]` anywhere
in the commit message to free up build resources.
<!--
The Contributing Guide at:
https://github.com/apache/thrift/blob/master/CONTRIBUTING.md
has more details and tips for committing properly.
-->
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]