-
Notifications
You must be signed in to change notification settings - Fork 1.8k
zstd: aws: compress: fix incompatible pointer glitches #10833
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
Signed-off-by: Hiroshi Hatake <[email protected]>
Signed-off-by: Hiroshi Hatake <[email protected]>
Signed-off-by: Hiroshi Hatake <[email protected]>
WalkthroughReturn types of flb_zstd_compress and flb_zstd_uncompress changed from size_t to int across header and implementation. Callers in AWS compression code and tests were updated to use direct function pointers matching the new signatures. No other logic or control flow changes were introduced. Changes
Sequence Diagram(s)sequenceDiagram
autonumber
actor Caller
participant ZSTD_API as flb_zstd_* (compress/uncompress)
participant ZSTD as libzstd
Caller->>ZSTD_API: call(in_data, in_len, &out_data, &out_len)
ZSTD_API->>ZSTD: perform (de)compression
alt success
ZSTD-->>ZSTD_API: result OK
ZSTD_API-->>Caller: return 0, out_data/out_len set
else error
ZSTD-->>ZSTD_API: error
ZSTD_API-->>Caller: return -1
end
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Possibly related PRs
Suggested labels
Suggested reviewers
Poem
📜 Recent review detailsConfiguration used: CodeRabbit UI Review profile: CHILL Plan: Pro 💡 Knowledge Base configuration:
You can enable these sources in your CodeRabbit configuration. 📒 Files selected for processing (4)
🧰 Additional context used🧠 Learnings (7)📓 Common learnings
📚 Learning: 2025-08-29T06:25:02.561Z
Applied to files:
📚 Learning: 2025-08-29T06:24:26.170Z
Applied to files:
📚 Learning: 2025-08-29T06:25:27.250Z
Applied to files:
📚 Learning: 2025-08-29T06:24:55.855Z
Applied to files:
📚 Learning: 2025-08-29T06:25:27.250Z
Applied to files:
📚 Learning: 2025-08-29T06:24:44.797Z
Applied to files:
🧬 Code graph analysis (3)tests/internal/aws_compress.c (1)
src/aws/flb_aws_compress.c (1)
include/fluent-bit/flb_zstd.h (1)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (26)
🔇 Additional comments (5)
✨ Finishing Touches
🧪 Generate unit tests
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. CodeRabbit Commands (Invoked using PR/Issue comments)Type Other keywords and placeholders
CodeRabbit Configuration File (
|
@cosmo0920 is there any other component that needs to be adjusted ? (I see others are using zstd) |
No, raw usages of size_t and int are interchangeable with lossy conversions. But, when making to use pointer, it's incompatible. |
This is following up PR for #10794.
From gcc-14 or above, a check of incompatible pointer types was starting to be quite struct behavior.
And I found that public functions on flb_zstd.c are not needed to use size_t as return types because they just return their status codes.
So, we need to adjust their return types and to remove needless type castings.
Enter
[N/A]
in the box, if an item is not applicable to your change.Testing
Before we can approve your change; please submit the following in a comment:
If this is a change to packaging of containers or native binaries then please confirm it works for all targets.
ok-package-test
label to test for all targets (requires maintainer to do).Documentation
Backporting
Fluent Bit is licensed under Apache 2.0, by submitting this pull request I understand that this code will be released under the terms of that license.
Summary by CodeRabbit