Repository navigation
Conversation
zackees
left a comment
There was a problem hiding this comment.
Coordinator review (comment, not approval: this account is the PR author).
Verdict: sound and mechanical; one coverage gap to close before the off-Linux builds get it.
What I checked
- RED → GREEN is real and in the right order.
631e47772adds only the flag,13fe40ab3states the conversions. The target-level opt-in is aCXX-only genex, so the C units of the target, MSVC, and the macOS.mmunits (OBJCXX, added byos-macos.cmake) are untouched, and the pins for-Wconversion/-Wfloat-conversionstay in place exactly as #2625's split describes. Flag ordering is right: the pins come from directory-scopeadd_compile_options(cmake/linux/compilerconfig.cmake), target options land after them on the command line, so-Wsign-conversionwins over-Wno-sign-conversion. - No suppression used. grep over the whole diff for
-Wno,pragma,diagnostic,NOLINT: nothing. Matches #2625's "no#pragma GCC diagnostic ignoredand no per-file-Wno-*". - The index/count casts are guarded at every site I traced.
obs_property_list_item_disabled(p, size_t(cur_idx))is reached only aftercur_idx != -1(ComboSelectToolbar,GameCaptureToolbar); theerase(begin() + ptrdiff_t(i))changes are all insidei < size()loops;SimpleOutput::UpdateRecording's newsize_t idx/idx2are only post-incremented into asize_tparameter;ReorderFilter(..., size_t)already tooksize_t, soFilterOrderInfo'sasyncIdx/effectIdxwere the actual fix;WHIPSimulcastEncoderscannot underflow becauselayers <= 1returns early; thesize_t(index_)cast inAccessibleAlignmentCell::textis safe because the only constructor loop isfor (int i = 0; i < cellCount; ++i)against a fixed 9-entry table. - Ledger correctly skipped — build tooling only, as #2625 states. No public header,
test/, or C test edits.
One gap: the flag is target-wide, the evidence is Linux-only
The replay that produced "337 findings → 0" came from the Linux Tier 2 compile DB, but target_compile_options(obs-studio ...) applies to every C++ unit of the target, including units Linux never compiles. I walked frontend/build/source-sets.json against the Linux source sets:
| set | unit | state |
|---|---|---|
MACOS |
frontend.macos+.hpp.cpp (OBSPermissions.cpp.hpp) |
clean, no integer conversions |
SPARKLE |
frontend.sparkle+.hpp.cpp (MacUpdateThread.cpp.hpp) |
clean |
FREEBSD |
frontend.freebsd+.hpp.cpp (CrashHandler_FreeBSD.cpp.hpp) |
clean |
FREEBSD_PLUGIN_MANAGER |
frontend.plugin-manager-bsd+.hpp.cpp |
two hits |
WINDOWS |
all | MSVC, excluded by the genex |
frontend/plugin-manager/PluginModuleLoader_BSD.cpp.hpp:124 and :190:
int bufferSize = os_get_config_path(userConfigPath.data(), userConfigPath.size(), nullptr);
if (bufferSize > 0) {
userConfigPath.resize(bufferSize); // int -> size_typeThat is -Wsign-conversion, and FreeBSD is Clang, so the genex matches and -Werror turns it into a build failure. Since FreeBSD is not in PR CI and the macOS GUI build only runs on schedule/release, PR CI cannot see this. Two-line fix, guarded by bufferSize > 0:
userConfigPath.resize(static_cast<size_t>(bufferSize));(The .mm macOS units are fine for the reason above; frontend.whatsnew+ and frontend.native-event-filter+ are also compiled by the Linux sets, so the What's New / event-filter C++ is covered by the replay.)
Nits, not blockers
OBSBasicTransform:widthForFlip/heightForFlipmoving fromuint32_ttointis the right type (it matchesobs_sceneitem_crop'sintfields and yourcrop.left = ui->cropLeft->value()change), but it is the one hunk where the value can differ: withcrop.left + crop.right > sourceWidththe old unsigned expression wrapped to a huge positive and the new one goes negative, soshiftX/shiftYdiffer in that corner. libobs already treats an over-crop as "crops all of it" (obs_scene_cropped_size), so negative reads better — just confirm it is intended rather than incidental.int sdrWhiteLevel/int hdrNominalPeakLevelare narrowing casts fromconfig_get_uint. Fine while the spinbox range stays underINT_MAX; if you read #2625's "a narrowing cast is only used where the range is provably in bounds" strictly, a bound check or a comment would settle it.
State at review time: uv run -m workflow.coordinator checks obs-studio 2886 → 25 passed, 0 failed, 8 running (Rust Tier 2 Linux queued, Rust Tests/Tier 2 macOS in flight), so the enqueue follows once they finish rather than now.
13fe40a to
ae6b165
Compare
|
Stacked on #2887 ( The macOS Tier 2 lane on the previous head (
|
ae6b165 to
4a62546
Compare
|
Restacked: |
|
Coordinator: the two red checks on this PR are not from its diff. Nothing to change in this PR. One thing to expect: its own AppleClang evidence is a Linux replay too (337 findings from the Tier 2 Linux compile database), so once libobs compiles on macOS the frontend TUs this PR converts may report macOS-only diagnostics of their own. Re-running the macOS lane after the libobs gap closes is the honest check; I will rebase this branch then. |
4a62546 to
6eeb347
Compare
The first green attempt still failed: the same #ifdef-only blind spot hides four more -Wsign-conversion diagnostics (CGLTexImageIOSurface2D takes GLsizei widths from uint32_t texture fields) and two -Wfloat-conversion ones (CGSize CGFloat dimensions into device_texture_create's uint32_t). State them at the call; values unchanged.
The libobs ratchet (#2877) had the same Linux-only replay blind spot: the macOS Tier 2 lane then reported CFIndex -> size_t (dstr_reserve), obs_key_t -> int (mouse button index), int -> UInt16 (UCKeyTranslate key code) and UniCharCount -> CFIndex (CFStringCreateWithCharactersNoCopy). State each at the call; values unchanged.
-Wsign-conversion on the macOS Tier 2 lane rejects strlen()'s size_t as the CFIndex byte count; cast at the boundary.
-RED: `Rust Tier 2 (macos-26)` on `07340d52e` + #2887's cocoa fix (job 123343547757) reports 19 `-Werror,-Wsign-conversion` / `-Wimplicit-int-conversion` diagnostics in the four Rust seam call sites below: `enum video_format`, `obs_bounds_type`, `obs_scale_type`, `obs_blending_method`, `obs_blending_type`, `gs_color_space` and `obs_deinterlace_mode` passed to a helper the port declares with an `int` parameter. AppleClang gives an all-non-negative enum an unsigned underlying type; GCC and Linux clang keep `int`, so #2877's replay of the same TUs could not see them. -GREEN: state the conversion at each call site, leaving the seam signatures and the Rust `c_int` ABI unchanged. Two further sites of the same class (obs_canvas_draw_technique()/reads_white_level() in obs.c.h, the deinterlace mode-change call) are cast with them so the next macOS wave does not re-report the group. No Rust or cmocka change: no signature moved, and the casts are behaviour-neutral (the values are enum members, not sentinels).
The next macOS Tier 2 wave after b43279b reports 19 more 'enum -> int' conversions, all in libobs/obs-source.c.h: the monitoring type fed to obs_source_audio_place_outputs(), the async and sync render plans' gs_color_space arguments, and src->format into obs_source_frame_copy_plan(). AppleClang gives all-positive enums an unsigned underlying type; the seam helpers take int (the Rust c_int ABI carries -1 sentinels), so each call site is an implicit conversion visible only on Apple platforms. Cast at each call site; signatures, Rust ABI and tests do not move.
6eeb347 to
57abc6a
Compare
|
Rebased onto the The This branch was cut from an older #2892 head (two of its three commits), so the lane compiled a CoreAudio TU the stack had not yet fixed. The stale |
|
Coordinator note for head Job Consequence for the stack: this lane cannot be green until the |
|
CI follow-up: The Evidence: |
|
Wave 2 of the same lane (run 40858510563, job 123399828559) surfaced the neighbouring libobs seams that the first fix let the compiler reach: Stated at those call sites:
|
|
Wave 3 (job 123410539596, head cba048e):
|
a90cf82 to
7bde56a
Compare
|
Dequeued from the merge queue: this branch and #2900 carry the same patch series (the Waiting for #2900 to merge, then I will rebase the commits unique to this branch ( |
|
Closing: everything this PR carried has landed on
The app-target flag this PR was opened for is on Verification that the lane is fixed: |
Refs #2625
Slice 1 of dropping the global conversion pins for the
obs-studioapp target:-Wsign-conversiononly. The other two groups (-Wconversion,-Wfloat-conversion) stay pinned for this target and follow in their own PRs;the flag list in
frontend/CMakeLists.txtis the single target-level opt-in:RED —
631e47772build(frontend): enable the sign-conversion warnings on the app target (#2625)only adds that flag. Replaying the frontend C++ units against the warm Tier 2
compile database with
ci/warning_findings.py --select '*frontend.*' --language cxxreports 337-Wsign-conversionfindings (190 sites in 53files), grouped by directory:
frontendfrontend/componentsfrontend/dialogsfrontend/importersfrontend/oauthfrontend/plugin-managerfrontend/settingsfrontend/utilityfrontend/widgetsfrontend/wizardsshared/properties-view,shared/qt/platformThe counts include the unity-build repetitions of the same header (e.g.
WHIPSimulcastEncoders.hppis compiled into 23 units).GREEN —
13fe40ab3frontend: state the sign conversions the app target now reports (#2625)states every conversion at its call site; no
-Wno-*, no#pragma, no per-fileexemption, no vendored code touched. Same replay on the same tree: 0
-Wsign-conversionfindings (the other two groups keep their pins and areunchanged).
What the fixes look like:
size_t/uint32_tAPI parameters werewidened where that was the natural type (
size_t iforobs_enum_*_types,size_t idxfor encoder slot counters,size_t asyncIdx/effectIdx), instead of adding a cast per call.(
static_cast<uint32_t>(duration),static_cast<int>(obs_source_get_width(...))),never a negative-to-unsigned conversion without a guard.
vec.erase(begin + idx),begin() + iterationLimit)and Qt container indices use
static_cast<std::ptrdiff_t>/static_cast<size_t>;OBSHotkeyWidget::RemoveEditnow takesstd::ptrdiff_t, which is whatstd::distancealready produced.QColorpackers share one adjustment: the shift lambda takes theintQt hands it and does the mask inunsigned.0u/1u(flags |= font.bold() ? OBS_FONT_BOLD : 0u,~(1u << mixerIdx)) so the complement stays unsigned.aspect_ratio()takes and returnsuint32_t, matching every caller.Verification
./lint --fixthen./lint:== lane lint: ok.ninja -j 12 obs-studioin the Tier 2 tree (which reconfiguredfrom this branch's
frontend/CMakeLists.txt, so the flag above is the one inthe regenerated compile database) links
frontend/obs-studio-rust-guisuccessfully.