Repository navigation
build(shared): ratchet the conversion warnings on happy-eyeballs, opts-parser and bpm (#2625) - #2856
Merged
Merged
Conversation
…lpers (#2625) RED: happy-eyeballs, opts-parser and bpm compile with their own -Wconversion, -Wsign-conversion and -Wfloat-conversion instead of inheriting the global -Wno-* pins. The target builds report 12 diagnostics: 7 in bpm.c.h, 3 in opts-parser.c.h and 2 in happy-eyeballs.c.h, so the build stops. Refs #2625
…lpers (#2625) GREEN for the three shared targets the previous commit enables the groups on. Each site now states the type it already had: - opts-parser: the two DARRAY walks are `size_t` counts in `struct obs_options`, and `bstrdup_n` takes the `size_t` length between the `=` and the param. - happy-eyeballs: `connect()` takes the address length the `addrinfo` already carries (no `(int)` narrowing), and the public getter returns its `socklen_t winner_addr_len` as the `int` it has always returned. - bpm: the frame counters are the `uint32_t` the struct stores, the SEI payload length is a `size_t` end to end (`sei_message_size` -> `bmalloc` -> `memcpy` -> return), and the metrics DARRAY no longer carries a signed index: `idx` starts at `bpm_metrics.num`, which is also the "not found" sentinel, so `da_erase` takes a `size_t` and no `-1` round-trips through `int64_t`. Rebuilt with the groups enabled: 12 -> 0 diagnostics, all three objects link. Refs #2625
zackees
commented
Oct 29, 2026
zackees
left a comment
Member
Author
There was a problem hiding this comment.
Reviewed — correctness holds and the change is mechanical; nothing here needs to go back to the author.
What I checked
- RED → GREEN is honest. RED
2570af96bturns on-Wconversion -Wsign-conversion -Wfloat-conversionfor the three targets without touching the sites (12 diagnostics reported in the PR body), GREENc872f588afixes exactly those sites and nothing else — 6 files, 34 insertions, 10 deletions, no other target in the diff. - No behaviour change on any edited path.
bpm.c.hframe counters:obs_output_get_total_frames/get_frames_droppedreturnuint64_tinto a struct field that has always beenuint32_t; the explicit cast states the existing width.payload_sizewas already returned assize_tbyextract_buffer_from_sei, so dropping theintround-trip removes a truncation rather than adding one. Thebpm_destroyindex rewrite is equivalent:idx = bpm_metrics.numis the not-found sentinel, the walk setsidx = i - 1, andidx < bpm_metrics.numis the oldidx >= 0for asize_t— the found element is still erased.opts-parser.c.h: the two DARRAY walks are pointer differences, sosize_tis the type the struct already stores;bstrdup_ntakes asize_tlength.happy-eyeballs.c.h:connect()takes thesocklen_ttheaddrinfoalready carries (the(int)cast was a narrowing, not a widening); the getter's(int)return keeps the documentedintsignature andwinner_addr_lenis bounded bysizeof(struct sockaddr_storage), so the cast cannot truncate.
- Pattern matches the merged slices (
plugins/linux-v4l2/CMakeLists.txt, #2849):COMPILE_LANG_AND_ID:C,...guard so C++ objects in these targets are unaffected, and the global pins stay until the last target is ratcheted. - No
docs/features.mdline needed: build flags only, no user-visible behaviour.
Nit, not blocking: the three identical target_compile_options blocks could eventually move to one helper when the remaining survey targets land, so the "leaves the flag lists once every target is ratcheted" comment has one home. Fine as three local blocks for now.
I'll queue it once the two still-running checks finish.
Member
Author
|
Handed off to the coordinator: PR CI is green ( |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Part of #2625 (the warning ratchet): the next slice after
linux-v4l2(#2849), moving to theshared/targets the survey listed. Three targets, one commit each side of RED/GREEN.RED
2570af96b:shared/happy-eyeballs,shared/opts-parserandplugins/obs-outputs/bpmcompile with their own-Wconversion -Wsign-conversion -Wfloat-conversioninstead of inheriting the global-Wno-*pins. The rebuild inobs-rust-linux-validatereports 12 diagnostics — 7 inbpm.c.h, 3 inopts-parser.c.h, 2 inhappy-eyeballs.c.h— and stops.GREEN
c872f588a: 12 → 0 diagnostics, all three objects compile and link. Each site now states the type it already had:shared/opts-parser/opts-parser.c.hsize_tcounts instruct obs_options;bstrdup_ntakes thesize_tlength between=and the paramshared/happy-eyeballs/happy-eyeballs.c.hconnect()takes theai_addrlentheaddrinfoalready carries (no(int)narrowing); the getter returns itssocklen_t winner_addr_lenas theintit has always returnedshared/bpm/bpm.c.huint32_tthe struct stores; the SEI payload length issize_tend to end; the metrics DARRAY drops the signed index —idxstarts atbpm_metrics.num, which is also the not-found sentinel, soda_erasetakes asize_tNo behavior change: every value is the same width or narrower on the path it already took.
./lintis green on the branch head (clang-format + gersemi).Ratchet now covers 15 targets. Remaining from the survey:
obs-ffmpeg,obs-outputsproper (407 diagnostics — the rtmp/mp4 muxers, a separate unit),linux-capture,win-capture,mac-capture, the frontend-ON C++ class, then the Linux pin deletion.Refs #2625