Skip to content

fix: Eliminate warnings for gcc16 and _FORTIFY_SOURCE=3 for snprintf#892

Open
paleolimbot wants to merge 3 commits into
apache:mainfrom
paleolimbot:string-printf
Open

fix: Eliminate warnings for gcc16 and _FORTIFY_SOURCE=3 for snprintf#892
paleolimbot wants to merge 3 commits into
apache:mainfrom
paleolimbot:string-printf

Conversation

@paleolimbot
Copy link
Copy Markdown
Member

The ArrowSchemaToString() function used snprintf(NULL, 0, "...") to calculate final buffer sizes; however, this led to warnings (either because all NULLs are bad in this case or because the compiler couldn't prove that n was zero). This led to CRAN warnings for nanoarrow and all packages that vendored it because CRAN compiles on gcc16. Opus 4.5 seemed to suggest _FORTIFY_SOURCE=3 rejected all null inputs to snprintf, so this PR removes them.

In the process I tidied up the printing a bit since it was hard to follow.

@codecov-commenter
Copy link
Copy Markdown

codecov-commenter commented Jun 4, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 78.59%. Comparing base (f11d517) to head (9961883).
⚠️ Report is 52 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #892      +/-   ##
==========================================
- Coverage   79.96%   78.59%   -1.38%     
==========================================
  Files         105      106       +1     
  Lines       15461    16128     +667     
  Branches     1738     1858     +120     
==========================================
+ Hits        12364    12675     +311     
- Misses       1998     2286     +288     
- Partials     1099     1167      +68     

☔ View full report in Codecov by Harness.
📢 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.

@paleolimbot paleolimbot marked this pull request as ready for review June 4, 2026 17:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants