Skip to content

Fix -Wstrict-prototypes warnings#1968

Merged
Dead2 merged 1 commit intozlib-ng:developfrom
ccawley2011:strict-prototypes
Sep 27, 2025
Merged

Fix -Wstrict-prototypes warnings#1968
Dead2 merged 1 commit intozlib-ng:developfrom
ccawley2011:strict-prototypes

Conversation

@ccawley2011
Copy link
Copy Markdown
Contributor

@ccawley2011 ccawley2011 commented Sep 25, 2025

Summary by CodeRabbit

  • Refactor
    • Standardized internal no-argument function signatures to explicitly use void across ARM and RISC-V feature detection and gzip initialization modules, improving consistency and clarity.
  • Impact
    • No user-visible changes. No behavior or performance impact; public APIs unchanged.

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai bot commented Sep 25, 2025

Walkthrough

Explicitly added void to no-argument function definitions across ARM, RISC-V, and gzlib modules to match declarations. No behavioral or control-flow changes.

Changes

Cohort / File(s) Summary
ARM feature helpers
arch/arm/arm_features.c
Updated three internal helpers to use explicit void parameter lists: arm_has_crc32(void), arm_has_neon(void), arm_has_simd(void). No logic changes.
RISC-V version check
arch/riscv/riscv_features.c
is_kernel_version_greater_or_equal_to_6_5 now explicitly declared as taking void; body unchanged.
gzlib init alignment
gzlib.c
Definition of gz_state_init now uses void parameter to align with its forward declaration; behavior unchanged.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~3 minutes

Pre-merge checks and finishing touches

❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 20.00% which is insufficient. The required threshold is 80.00%. You can run @coderabbitai generate docstrings to improve docstring coverage.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title Check ✅ Passed The title clearly and concisely indicates that the changes address -Wstrict-prototypes warnings, which matches the updates to function signatures throughout the patch to explicitly declare void parameters. It directly reflects the main purpose of the changes without extra detail or noise.
✨ Finishing touches
  • 📝 Generate Docstrings
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment

📜 Recent review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 7800569 and 83a25cf.

📒 Files selected for processing (3)
  • arch/arm/arm_features.c (3 hunks)
  • arch/riscv/riscv_features.c (1 hunks)
  • gzlib.c (1 hunks)
🧰 Additional context used
🧬 Code graph analysis (2)
arch/arm/arm_features.c (1)
arch/arm/arm_features.h (2)
  • arm_cpu_features (8-12)
  • arm_cpu_features (14-14)
gzlib.c (1)
gzguts.h (2)
  • PREFIX3 (101-134)
  • struct gzFile_s (103-103)
⏰ 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). (79)
  • GitHub Check: macOS GCC UBSAN (ARM64)
  • GitHub Check: macOS GCC UBSAN
  • GitHub Check: macOS Clang (Target 10.10)
  • GitHub Check: EL9 Clang S390X DFLTCC MSAN
  • GitHub Check: Ubuntu GCC AARCH64 No ARMv8 UBSAN
  • GitHub Check: Ubuntu GCC AARCH64 Compat No Opt UBSAN
  • GitHub Check: Analyze (cpp)
  • GitHub Check: macOS GCC UBSAN (ARM64)
  • GitHub Check: macOS GCC UBSAN
  • GitHub Check: macOS Clang Native Instructions (ARM64)
  • GitHub Check: macOS Clang (Target 10.10)
  • GitHub Check: EL9 Clang S390X DFLTCC MSAN
  • GitHub Check: Ubuntu GCC AARCH64 No ARMv8 UBSAN
  • GitHub Check: Ubuntu GCC AARCH64 Compat No Opt UBSAN
  • GitHub Check: Analyze (cpp)
  • GitHub Check: macOS GCC UBSAN (ARM64)
  • GitHub Check: macOS GCC UBSAN
  • GitHub Check: macOS Clang Native Instructions (ARM64)
  • GitHub Check: macOS Clang (Target 10.10)
  • GitHub Check: EL9 Clang S390X DFLTCC MSAN
  • GitHub Check: Ubuntu GCC AARCH64 No ARMv8 UBSAN
  • GitHub Check: Ubuntu GCC AARCH64 Compat No Opt UBSAN
  • GitHub Check: Analyze (cpp)
  • GitHub Check: macOS GCC UBSAN (ARM64)
  • GitHub Check: macOS GCC UBSAN
  • GitHub Check: macOS Clang Native Instructions (ARM64)
  • GitHub Check: macOS Clang (Target 10.10)
  • GitHub Check: EL9 Clang S390X DFLTCC MSAN
  • GitHub Check: Ubuntu GCC AARCH64 No ARMv8 UBSAN
  • GitHub Check: Ubuntu GCC AARCH64 Compat No Opt UBSAN
  • GitHub Check: Analyze (cpp)
  • GitHub Check: macOS GCC UBSAN (ARM64)
  • GitHub Check: macOS GCC UBSAN
  • GitHub Check: macOS Clang Native Instructions (ARM64)
  • GitHub Check: macOS Clang (Target 10.10)
  • GitHub Check: EL9 Clang S390X DFLTCC MSAN
  • GitHub Check: Ubuntu GCC AARCH64 No ARMv8 UBSAN
  • GitHub Check: Ubuntu GCC AARCH64 Compat No Opt UBSAN
  • GitHub Check: Analyze (cpp)
  • GitHub Check: macOS GCC UBSAN (ARM64)
  • GitHub Check: macOS GCC UBSAN
  • GitHub Check: macOS Clang Native Instructions (ARM64)
  • GitHub Check: macOS Clang (Target 10.10)
  • GitHub Check: EL9 Clang S390X DFLTCC MSAN
  • GitHub Check: Ubuntu GCC AARCH64 No ARMv8 UBSAN
  • GitHub Check: Ubuntu GCC AARCH64 Compat No Opt UBSAN
  • GitHub Check: Analyze (cpp)
  • GitHub Check: macOS GCC UBSAN (ARM64)
  • GitHub Check: macOS GCC UBSAN
  • GitHub Check: macOS Clang Native Instructions (ARM64)
  • GitHub Check: macOS Clang (Target 10.10)
  • GitHub Check: EL9 Clang S390X DFLTCC MSAN
  • GitHub Check: Ubuntu GCC AARCH64 No ARMv8 UBSAN
  • GitHub Check: Ubuntu GCC AARCH64 Compat No Opt UBSAN
  • GitHub Check: Analyze (cpp)
  • GitHub Check: macOS GCC UBSAN (ARM64)
  • GitHub Check: macOS GCC UBSAN
  • GitHub Check: macOS Clang Native Instructions (ARM64)
  • GitHub Check: macOS Clang (Target 10.10)
  • GitHub Check: EL9 Clang S390X DFLTCC MSAN
  • GitHub Check: Ubuntu GCC AARCH64 No ARMv8 UBSAN
  • GitHub Check: Ubuntu GCC AARCH64 Compat No Opt UBSAN
  • GitHub Check: Analyze (cpp)
  • GitHub Check: macOS GCC UBSAN (ARM64)
  • GitHub Check: macOS GCC UBSAN
  • GitHub Check: macOS Clang Native Instructions (ARM64)
  • GitHub Check: macOS Clang (Target 10.10)
  • GitHub Check: EL9 Clang S390X DFLTCC MSAN
  • GitHub Check: Ubuntu GCC AARCH64 No ARMv8 UBSAN
  • GitHub Check: Ubuntu GCC AARCH64 Compat No Opt UBSAN
  • GitHub Check: Analyze (cpp)
  • GitHub Check: macOS GCC UBSAN (ARM64)
  • GitHub Check: macOS GCC UBSAN
  • GitHub Check: macOS Clang Native Instructions (ARM64)
  • GitHub Check: macOS Clang (Target 10.10)
  • GitHub Check: EL9 Clang S390X DFLTCC MSAN
  • GitHub Check: Ubuntu GCC AARCH64 No ARMv8 UBSAN
  • GitHub Check: Ubuntu GCC AARCH64 Compat No Opt UBSAN
  • GitHub Check: Analyze (cpp)
🔇 Additional comments (3)
arch/riscv/riscv_features.c (1)

16-16: Explicit void signature aligns with prototype

Matches the header declaration, silences -Wstrict-prototypes, and is ABI-neutral. No further action needed.

gzlib.c (1)

26-28: Definition now matches forward declaration

Bringing the definition in line with static gzFile gz_state_init(void); clears the warning without affecting behavior.

arch/arm/arm_features.c (1)

28-103: void parameter lists look good

The updated signatures (arm_has_crc32, arm_has_neon, arm_has_simd) now conform to strict-prototype expectations and stay consistent with their uses throughout the file.


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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@codecov
Copy link
Copy Markdown

codecov bot commented Sep 25, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 82.81%. Comparing base (7800569) to head (83a25cf).
⚠️ Report is 2 commits behind head on develop.

Additional details and impacted files
@@             Coverage Diff             @@
##           develop    #1968      +/-   ##
===========================================
+ Coverage    81.60%   82.81%   +1.20%     
===========================================
  Files          163      163              
  Lines        14073    14120      +47     
  Branches      3165     3165              
===========================================
+ Hits         11484    11693     +209     
+ Misses        1597     1412     -185     
- Partials       992     1015      +23     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@Dead2 Dead2 merged commit 46cf470 into zlib-ng:develop Sep 27, 2025
155 checks passed
@ccawley2011 ccawley2011 deleted the strict-prototypes branch September 27, 2025 19:08
@Dead2 Dead2 mentioned this pull request Nov 5, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants