Skip to content

[FIX] networking: print int length with %d in NETWORKING_DEBUG output - #2311

Merged
cfsmp3 merged 1 commit into
masterfrom
fix/networking-debug-format-specifiers
Aug 10, 2026
Merged

[FIX] networking: print int length with %d in NETWORKING_DEBUG output#2311
cfsmp3 merged 1 commit into
masterfrom
fix/networking-debug-format-specifiers

Conversation

@cfsmp3

@cfsmp3 cfsmp3 commented Aug 10, 2026

Copy link
Copy Markdown
Contributor

Follow-up to #2307, picking up the one bit its sibling PR got right.

net_send_cc() takes int len, but its debug line printed it with %u:

fprintf(stderr, "[C] Sending %u bytes\n", len);   // len is int

#2307 fixed the other two specifiers in these blocks (%u%zu where len is size_t) but missed this one. #2175 by @Varadraj75 had it right — that PR was closed after five months without a rebase, so this ports the remaining fix.

Scope

These blocks only compile under -DNETWORKING_DEBUG=ON, so no shipped build was affected. gcc doesn't diagnose %u against int (same width), which is why it survived the sweep on #2307 — I found it by auditing every specifier in the enabled blocks rather than trusting the compiler.

Verification

Enabling the debug blocks and compiling with -Wall -Wextra -Wformat=2, both with and without -DDISABLE_RUST:

  • before: [C] Sending %u bytes with an int
  • after: zero format diagnostics in either configuration

The two remaining -Wpointer-sign warnings on write_block() are pre-existing, in live code, and unrelated to the debug output — left alone deliberately.

clang-format clean. One line, one file.

Credit: @Varadraj75 reported #2174 and caught this specifier in #2175.

net_send_cc() takes `int len` but the debug line printed it with %u. The other
two specifiers in these blocks were corrected in #2307; this one was missed.

The blocks only compile with -DNETWORKING_DEBUG=ON, so nothing shipped was
affected. Enabling them and building with -Wall -Wextra -Wformat=2 now reports
no format diagnostics at all; the two remaining -Wpointer-sign warnings on
write_block() are pre-existing and unrelated to the debug output.

Picked up from #2175 by Varadraj75, who reported the underlying issue (#2174)
and caught this specifier there; that PR was closed after going five months
without a rebase.
@ccextractor-bot

Copy link
Copy Markdown
Collaborator
CCExtractor CI platform finished running the test files on linux. Below is a summary of the test results, when compared to test for commit 06179f7...:
Report Name Tests Passed
Broken 10/13
CEA-708 2/14
DVB 3/7
DVD 3/3
DVR-MS 2/2
General 27/27
Hardsubx 1/1
Hauppage 3/3
MP4 3/3
NoCC 10/10
Options 81/86
Teletext 20/21
WTV 13/13
XDS 34/34

NOTE: The following tests have been failing on the master branch as well as the PR:

Congratulations: Merging this PR would fix the following tests:

  • ccextractor --out=srt --latin1 611b4a9235..., Last passed: Never
  • ccextractor --autoprogram --out=ttxt --latin1 1020459a86..., Last passed: Never
  • ccextractor --autoprogram --out=srt --latin1 --quant 0 85271be4d2..., Last passed: Never
  • ccextractor --autoprogram --out=ttxt --latin1 132d7df7e9..., Last passed: Never
  • ccextractor --autoprogram --out=ttxt --latin1 99e5eaafdc..., Last passed: Never
  • ccextractor --autoprogram --out=ttxt --latin1 --ucla dab1c1bd65..., Last passed: Never
  • ccextractor --autoprogram --out=ttxt --latin1 01509e4d27..., Last passed: Never
  • ccextractor --out=srt --latin1 --autoprogram 29e5ffd34b..., Last passed: Never
  • ccextractor --out=spupng c83f765c66..., Last passed: Never
  • ccextractor --dru c83f765c66..., Last passed: Never
  • ccextractor --startat 4 --endat 7 c83f765c66..., Last passed: Never
  • ccextractor --codec dvbsub --out=spupng 85271be4d2..., Last passed: Never
  • ccextractor --startcreditstext "CCextractor Start crdit Testing" c4dd893cb9..., Last passed: Never
  • ccextractor --startcreditsnotbefore 1 --startcreditstext "CCextractor Start crdit Testing" c4dd893cb9..., Last passed: Never
  • ccextractor --startcreditsnotafter 2 --startcreditstext "CCextractor Start crdit Testing" c4dd893cb9..., Last passed: Never
  • ccextractor --startcreditsforatleast 1 --startcreditstext "CCextractor Start crdit Testing" c4dd893cb9..., Last passed: Never
  • ccextractor --startcreditsforatmost 2 --startcreditstext "CCextractor Start crdit Testing" c4dd893cb9..., Last passed: Never
  • ccextractor --out=srt --latin1 f23a544ba8..., Last passed: Never
  • ccextractor --autoprogram --out=srt --latin1 --ucla d037c7509e..., Last passed: Never
  • ccextractor --autoprogram --out=srt --latin1 --ucla 7d3f25c32c..., Last passed: Never
  • ccextractor --autoprogram --out=ttxt --latin1 --ucla --xds 7f41299cc7..., Last passed: Never

This PR does not introduce any new test failures. However, some tests are failing on both master and this PR (see above).

Check the result page for more info.

@ccextractor-bot

Copy link
Copy Markdown
Collaborator
CCExtractor CI platform finished running the test files on windows. Below is a summary of the test results, when compared to test for commit 749b355...:
Report Name Tests Passed
Broken 9/13
CEA-708 2/14
DVB 1/7
DVD 3/3
DVR-MS 2/2
General 22/27
Hardsubx 1/1
Hauppage 3/3
MP4 3/3
NoCC 10/10
Options 72/86
Teletext 20/21
WTV 12/13
XDS 31/34

Your PR breaks these cases:

  • ccextractor --out=srt --latin1 611b4a9235...
  • ccextractor --autoprogram --out=ttxt --latin1 1020459a86...
  • ccextractor --autoprogram --out=srt --latin1 --quant 0 85271be4d2...
  • ccextractor --autoprogram --out=ttxt --latin1 132d7df7e9...
  • ccextractor --autoprogram --out=ttxt --latin1 99e5eaafdc...
  • ccextractor --autoprogram --out=ttxt --latin1 --ucla dab1c1bd65...
  • ccextractor --autoprogram --out=ttxt --latin1 01509e4d27...
  • ccextractor --out=srt --latin1 --autoprogram 29e5ffd34b...
  • ccextractor --out=spupng c83f765c66...
  • ccextractor --dru c83f765c66...
  • ccextractor --startat 4 --endat 7 c83f765c66...
  • ccextractor --codec dvbsub --out=spupng 85271be4d2...
  • ccextractor --startcreditstext "CCextractor Start crdit Testing" c4dd893cb9...
  • ccextractor --startcreditsnotbefore 1 --startcreditstext "CCextractor Start crdit Testing" c4dd893cb9...
  • ccextractor --startcreditsnotafter 2 --startcreditstext "CCextractor Start crdit Testing" c4dd893cb9...
  • ccextractor --startcreditsforatleast 1 --startcreditstext "CCextractor Start crdit Testing" c4dd893cb9...
  • ccextractor --startcreditsforatmost 2 --startcreditstext "CCextractor Start crdit Testing" c4dd893cb9...
  • ccextractor --out=srt --latin1 f23a544ba8...
  • ccextractor --autoprogram --out=srt --latin1 --ucla d037c7509e...
  • ccextractor --autoprogram --out=srt --latin1 --ucla 7d3f25c32c...
  • ccextractor --autoprogram --out=ttxt --latin1 --ucla --xds 7f41299cc7...

NOTE: The following tests have been failing on the master branch as well as the PR:


It seems that not all tests were passed completely. This is an indication that the output of some files is not as expected (but might be according to you).

Check the result page for more info.

@cfsmp3
cfsmp3 merged commit 0f224b8 into master Aug 10, 2026
47 of 48 checks passed
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