Repository navigation
Fix gcc16 -Werror compile issues - #3784
Conversation
|
No actionable comments were generated in the recent review. π βΉοΈ Recent review infoβοΈ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Run ID: π Files selected for processing (5)
π€ Files with no reviewable changes (2)
β Files skipped from review due to trivial changes (2)
π§ Files skipped from review as they are similar to previous changes (1)
π WalkthroughWalkthroughReorders C header includes across several source and header files and adds bytes-per-pixel validation to pixelcopy routines, raising ChangesInclude reorganization & pixel-size validation
Estimated code review effortπ― 3 (Moderate) | β±οΈ ~20 minutes Suggested labels
Suggested reviewers
π₯ Pre-merge checks | β 4 | β 1β Failed checks (1 warning)
β Passed checks (4 passed)
βοΈ Tip: You can configure your own custom pre-merge checks in the settings. β¨ Finishing Touchesπ Generate docstrings
π§ͺ Generate unit tests (beta)
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. Review rate limit: 7/8 reviews remaining, refill in 7 minutes and 30 seconds.Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
π€ Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@src_c/pixelcopy.c`:
- Around line 278-282: surface_to_array still calls _copy_unmapped for ndim==3
and _copy_unmapped writes pixelsize bytes into the 4-byte _pc_pixel_t union, so
add the same guard used for _copy_colorplane: check pixelsize <=
sizeof(_pc_pixel_t) (or <=4) before allowing the unmapped/deep-color path and
raise PyExc_ValueError via PyErr_Format if it exceeds that; update the
conditional logic in surface_to_array (the branch that routes to _copy_unmapped
for ndim==3) to perform this check and fail early to prevent out-of-bounds
writes into _pc_pixel_t.
πͺ Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
βΉοΈ Review info
βοΈ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
Run ID: 2b4ab4d3-c9c0-4935-98ca-2dc93892f27e
π Files selected for processing (5)
src_c/font.hsrc_c/include/pygame_font.hsrc_c/pixelcopy.csrc_c/scrap.csrc_c/surface.h
π€ Files with no reviewable changes (2)
- src_c/include/pygame_font.h
- src_c/surface.h
oddbookworm
left a comment
There was a problem hiding this comment.
Fixed the issue for me, thanks! π
PR to fix the Fedora 44 compile time issues initially reported by @DickerDackel on discord. Fedora 44 is the first major distro to ship with the latest GCC 16. This new GCC version now raises more warnings which become errors in
dev.py install.This PR reorganizes some includes to ensure that
Python.his always included first. This fixes_XOPEN_SOUCE/_POSIX_C_SOURCEmacro redefinition issues. It also adds extra error checking in one place for bpp to silence new size warnings.