Repository navigation
build(obs-ffmpeg): drop the conversion pins from the target (#2625) - #2865
Conversation
RED: the target now compiles with -Wconversion, -Wsign-conversion and -Wfloat-conversion instead of inheriting the global -Wno-* pins. The Tier 2 replay of the target's 8 unity TUs reports 109 diagnostics (-Wsign-conversion 84, -Wconversion 25) across 12 files.
GREEN: the 109 diagnostics the RED commit exposed are stated at their boundaries, and the target's 12 translation units replay clean with the three groups on. - srt.h: the 18 strtol option reads are int fields; the sockaddr length libsrt takes as int; the session-summary percentages are double. - mpegts/output/vaapi/video-encoders: the AVRational fields, the encoder dimensions, the gop expression (int arithmetic now, so the unsigned fps fields no longer promote it) and the size arguments. - vaapi: the surface handle is a VASurfaceID, and the DRM fourcc the colour-format helper takes as int. - rist/source/mux/audio-encoders/av1/openh264: payload sizes, pointer differences, timestamps and the H.264/AV1 header sizes. - shared/media-playback (compiled into this target): the cache and frame timestamps keep int64 arithmetic and convert once at the assignment; the size and line-size fields are explicit. No behaviour change: every cast keeps the value the code already computed. The global -Wno-conversion / -Wno-sign-conversion / -Wno-float-conversion stay until every target is ratcheted.
|
Handed off to the coordinator. #2865 is green: One coverage gap, stated rather than hidden: this target's plugin TUs are not built by PR CI, so the macOS Claim continues; the next target is |
…ed (obs-rust#2870) obs-rust#2865 turned on -Wconversion/-Wsign-conversion/-Wfloat-conversion for the obs-ffmpeg target and fixed the 109 diagnostics its Linux replay reported, but that replay cannot see two macOS-only diagnostics: the plugin target is not built in the Linux Tier 2 tree, and clang (with the Xcode warning set and CMAKE_COMPILE_WARNING_AS_ERROR) reports both as errors. The nightly Scheduled run 40825610950 at 5c3a91b is red in `Build macOS (x86_64)` and `Analyze macOS (clang-analyze)` because of them: - obs-ffmpeg-rist.h:175 passes RISTContext::profile (an int field holding RIST_PROFILE_MAIN) to rist_sender_create(), which takes enum rist_profile. - obs-ffmpeg-source.c.h:437 assigns obs_data_get_int() (a long long) to `enum video_range_type range`. Both keep the value the code already computed; no -Wno-* pin returns. Fixes obs-rust#2869 Co-authored-by: Hermes Agent <[email protected]>
Slice of #2625: the conversion groups on
obs-ffmpeg, with every conversion in the target's own translation units fixed at the call site.RED
07c1a9555adds the three-W*conversionenablers to theobs-ffmpegtarget only. Replaying the target's 14 Tier 2 translation units (its 8 unity TUs plus the twoshared/media-playbackunity TUs it compiles in) from the build tree's compile database, with the global-Wno-conversion/-Wno-sign-conversion/-Wno-float-conversionpins dropped, reports 109 diagnostics in 12 files:obs-ffmpeg-srt.hobs-ffmpeg-mpegts.c.hobs-ffmpeg-output.c.hobs-ffmpeg-vaapi.c.hobs-ffmpeg-mux.c.hobs-ffmpeg-video-encoders.c.hobs-ffmpeg-audio-encoders.c.hobs-ffmpeg-rist.hobs-ffmpeg-source.c.hobs-ffmpeg-av1.c.hobs-ffmpeg-openh264.c.hobs-ffmpeg-host-linux.c.h84 were
-Wsign-conversion, 25-Wconversion.GREEN
92c494ef7states each one at its boundary:srt.h: the 18strtoloption reads areintfields, the address length libsrt takes is anint, and the session-summary percentages are computed indouble.mpegts/output/vaapi/video-encoders: theAVRationalfields and the encoder width/height, and the gop expression isintarithmetic now (keyint_sec * (int)voi->fps_num / (int)voi->fps_den) so the unsigned fps fields no longer promote it; the sizes handed toav_malloc/calloc/memcpy/av_memdup/da_copy_array/obs_extract_*_headers.vaapi: the exported surface handle is aVASurfaceID, and the DRM fourcc passed todrm_to_gs_color_format(anintparameter) is explicit.rist/source/mux/audio-encoders/av1/openh264: payload sizes, the pointer difference intodstr_resize, and the packet/hdr sizes.shared/media-playback(compiled into this target, so it inherits the flags): the cache and frame timestamps keepint64arithmetic and convert once at the assignment, and theuint32/uint64frame fields,next_nsaccumulations and line sizes are explicit.Every cast keeps the value the code already computed; there is no pragma and no per-file
-Wno-*.Evidence
ci/warning_findings.py --language all, compdb of the configured tree, three pins dropped; the only residue is-Wpedantic: ISO C forbids an empty translation uniton the generatedcmake_pch.h.cstub, which the real build compiles as-x c-header).obs-rust-linux-validate:e756cdba69646bd5at this tip (allobs-ffmpegobjects deleted first):ninja obs-ffmpeg→RC=0, 0warning:lines, 0error:lines,obs-ffmpeg.solinked../lintclean (clang-format, gersemi, the repo Dylints).PCH note for the next slice: enabling the groups on
obs-ffmpegalso exposes the twoshared/media-playbackunity TUs, because this target compiles that shared code in; a replay that selects files by the plugin's own path misses 24 of the 109.The global pins stay until every target is ratcheted; this slice only removes them from this target's flag list. Windows uses MSVC, which the generator expression does not match, so this target's MSVC ratchet is unchanged.
Refs #2625. No
docs/features.mdline: build tooling only.