Repository navigation
cmake: Enable -Wdouble-promotion for C - #596
Merged
Merged
Conversation
…ons (GREEN) Explicit (double) casts keep every computed value identical. The cmocka tests and the SWIG-generated scripting wrappers are exempt per target. Refs #516 Local-Gate: v1 tree=f81a6188e1b51d8b4011e6b48651686829d173ea secs=275 lanes=lint:run,rust-test:run,cross:run,tier2-linux:run Ci-Attestation: {"at":1791907539,"gate":"rust/all/fmt","host":"linux-x86_64","key":"36c83b6980d7cc0036521b67f397ab45be48cd3a63a8fe340a1fb78fe2c6a872","lane":"lint","parents":["ce8aa1ed2699d1ab16e7804f5b46cb092737bbe1"],"secs":20,"stamp":"1214ec59ef6058047b134d4bb2ebe624","tree":"f81a6188e1b51d8b4011e6b48651686829d173ea","v":1,"via":"run"} Ci-Attestation: {"at":1791907539,"gate":"rust/x86_64-unknown-linux-gnu/clippy","host":"linux-x86_64","key":"36c83b6980d7cc0036521b67f397ab45be48cd3a63a8fe340a1fb78fe2c6a872","lane":"lint","parents":["ce8aa1ed2699d1ab16e7804f5b46cb092737bbe1"],"secs":20,"stamp":"5b40b3fe78df9a7060965b4b341452f0","tree":"f81a6188e1b51d8b4011e6b48651686829d173ea","v":1,"via":"run"} Ci-Attestation: {"at":1791907539,"gate":"rust/x86_64-unknown-linux-gnu/test","host":"linux-x86_64","key":"2d6731b9d00f46514f445333fa7fb1e0f19a5d5d0c32d8852451a25c8217cd4f","lane":"rust-test","parents":["ce8aa1ed2699d1ab16e7804f5b46cb092737bbe1"],"secs":84,"stamp":"e4015ef0caa2b48fa202d2aa73f5b986","tree":"f81a6188e1b51d8b4011e6b48651686829d173ea","v":1,"via":"run"} Ci-Attestation: {"at":1791907539,"gate":"rust/x86_64-pc-windows-msvc/clippy","host":"linux-x86_64","key":"d234f895256dc2f290c13a3b297b7a45a95325597739c42f95fd3620586bf107","lane":"cross","parents":["ce8aa1ed2699d1ab16e7804f5b46cb092737bbe1"],"secs":61,"stamp":"25085dbe3aeb0cd6ebb19facea3709ae","tree":"f81a6188e1b51d8b4011e6b48651686829d173ea","v":1,"via":"run"} Ci-Attestation: {"at":1791907539,"gate":"rust/x86_64-pc-windows-msvc/dylint","host":"linux-x86_64","key":"d234f895256dc2f290c13a3b297b7a45a95325597739c42f95fd3620586bf107","lane":"cross","parents":["ce8aa1ed2699d1ab16e7804f5b46cb092737bbe1"],"secs":61,"stamp":"2feaa7a9cb0d3940290797bc98adcc29","tree":"f81a6188e1b51d8b4011e6b48651686829d173ea","v":1,"via":"run"} Ci-Attestation: {"at":1791907539,"gate":"rust/aarch64-apple-darwin/clippy","host":"linux-x86_64","key":"d234f895256dc2f290c13a3b297b7a45a95325597739c42f95fd3620586bf107","lane":"cross","parents":["ce8aa1ed2699d1ab16e7804f5b46cb092737bbe1"],"secs":61,"stamp":"a0c9e7dc5329142c7be1cac1ddb90d18","tree":"f81a6188e1b51d8b4011e6b48651686829d173ea","v":1,"via":"run"} Ci-Attestation: {"at":1791907539,"gate":"rust/aarch64-apple-darwin/dylint","host":"linux-x86_64","key":"d234f895256dc2f290c13a3b297b7a45a95325597739c42f95fd3620586bf107","lane":"cross","parents":["ce8aa1ed2699d1ab16e7804f5b46cb092737bbe1"],"secs":61,"stamp":"2fb937b560d7153fdafe32ef0018ab84","tree":"f81a6188e1b51d8b4011e6b48651686829d173ea","v":1,"via":"run"} Ci-Attestation: {"at":1791907539,"gate":"rust/x86_64-apple-darwin/clippy","host":"linux-x86_64","key":"d234f895256dc2f290c13a3b297b7a45a95325597739c42f95fd3620586bf107","lane":"cross","parents":["ce8aa1ed2699d1ab16e7804f5b46cb092737bbe1"],"secs":61,"stamp":"cd85a5bd8cfe0c3a85b37b11440a43a2","tree":"f81a6188e1b51d8b4011e6b48651686829d173ea","v":1,"via":"run"} Ci-Attestation: {"at":1791907539,"gate":"rust/x86_64-apple-darwin/dylint","host":"linux-x86_64","key":"d234f895256dc2f290c13a3b297b7a45a95325597739c42f95fd3620586bf107","lane":"cross","parents":["ce8aa1ed2699d1ab16e7804f5b46cb092737bbe1"],"secs":61,"stamp":"517ecc3892bca7329f0186463bc5b32a","tree":"f81a6188e1b51d8b4011e6b48651686829d173ea","v":1,"via":"run"} Ci-Attestation: {"at":1791907539,"gate":"cpp/linux-x64/tier2","host":"linux-x86_64","key":"edba8f30a2d6053a0a6943541da4c56a7e58c890f78392f10c759c820371d470","lane":"tier2-linux","parents":["ce8aa1ed2699d1ab16e7804f5b46cb092737bbe1"],"secs":110,"stamp":"a53c5ae001c993968956ee8e7bb787e0","tree":"f81a6188e1b51d8b4011e6b48651686829d173ea","v":1,"via":"run"}
The Tier 2 build skips scripting and most plugins; a full Linux build (scripting on) and MSVC found these. Explicit casts keep each value. MSVC's C4244 wants the double sinf argument in obs-source.c narrowed explicitly. pipewire.c's RAD() takes the rotation as float, as obs-source.c does. The vendored rnnoise gets -Wno-double-promotion. Refs #516 Local-Gate: v1 tree=beef8988a00cf995598e3d424e93fd501624ee95 secs=341 lanes=lint:run,rust-test:run,cross:run,tier2-linux:run Ci-Attestation: {"at":1791908547,"gate":"rust/all/fmt","host":"linux-x86_64","key":"ce326d05ec7944b96bd8801c3034ba3331bfa9b6c65f8c1cdc24767e2bd997c3","lane":"lint","parents":["4f8e97a441f62941d397bd8d2c491fbf1fe64c9f"],"secs":17,"stamp":"968471f2b763c643150c04f8a36c1f70","tree":"beef8988a00cf995598e3d424e93fd501624ee95","v":1,"via":"run"} Ci-Attestation: {"at":1791908547,"gate":"rust/x86_64-unknown-linux-gnu/clippy","host":"linux-x86_64","key":"ce326d05ec7944b96bd8801c3034ba3331bfa9b6c65f8c1cdc24767e2bd997c3","lane":"lint","parents":["4f8e97a441f62941d397bd8d2c491fbf1fe64c9f"],"secs":17,"stamp":"0fb876142008620b01af412788761f17","tree":"beef8988a00cf995598e3d424e93fd501624ee95","v":1,"via":"run"} Ci-Attestation: {"at":1791908547,"gate":"rust/x86_64-unknown-linux-gnu/test","host":"linux-x86_64","key":"f3c3e73d69ab08fa19352d69f5574595c18bff324e86904a71f94277d8c02dc8","lane":"rust-test","parents":["4f8e97a441f62941d397bd8d2c491fbf1fe64c9f"],"secs":113,"stamp":"9f09e1c92b4138e01b7041545543b67c","tree":"beef8988a00cf995598e3d424e93fd501624ee95","v":1,"via":"run"} Ci-Attestation: {"at":1791908547,"gate":"rust/x86_64-pc-windows-msvc/clippy","host":"linux-x86_64","key":"2c8a88faa1390454fd96d766ec27fd178374026ccafd5c9d8e289e1c0159ac4f","lane":"cross","parents":["4f8e97a441f62941d397bd8d2c491fbf1fe64c9f"],"secs":97,"stamp":"403acf7382254ae532014b61e0d6350d","tree":"beef8988a00cf995598e3d424e93fd501624ee95","v":1,"via":"run"} Ci-Attestation: {"at":1791908547,"gate":"rust/x86_64-pc-windows-msvc/dylint","host":"linux-x86_64","key":"2c8a88faa1390454fd96d766ec27fd178374026ccafd5c9d8e289e1c0159ac4f","lane":"cross","parents":["4f8e97a441f62941d397bd8d2c491fbf1fe64c9f"],"secs":97,"stamp":"038722ebbac8d43eca00b70400236da0","tree":"beef8988a00cf995598e3d424e93fd501624ee95","v":1,"via":"run"} Ci-Attestation: {"at":1791908547,"gate":"rust/aarch64-apple-darwin/clippy","host":"linux-x86_64","key":"2c8a88faa1390454fd96d766ec27fd178374026ccafd5c9d8e289e1c0159ac4f","lane":"cross","parents":["4f8e97a441f62941d397bd8d2c491fbf1fe64c9f"],"secs":97,"stamp":"95e154eb5dcf62a3e68e2dde958bf6ed","tree":"beef8988a00cf995598e3d424e93fd501624ee95","v":1,"via":"run"} Ci-Attestation: {"at":1791908547,"gate":"rust/aarch64-apple-darwin/dylint","host":"linux-x86_64","key":"2c8a88faa1390454fd96d766ec27fd178374026ccafd5c9d8e289e1c0159ac4f","lane":"cross","parents":["4f8e97a441f62941d397bd8d2c491fbf1fe64c9f"],"secs":97,"stamp":"93fa82eb7eba304b121add7c9165c1a1","tree":"beef8988a00cf995598e3d424e93fd501624ee95","v":1,"via":"run"} Ci-Attestation: {"at":1791908547,"gate":"rust/x86_64-apple-darwin/clippy","host":"linux-x86_64","key":"2c8a88faa1390454fd96d766ec27fd178374026ccafd5c9d8e289e1c0159ac4f","lane":"cross","parents":["4f8e97a441f62941d397bd8d2c491fbf1fe64c9f"],"secs":97,"stamp":"3f0d0cc644887b219e5383a34c6332dd","tree":"beef8988a00cf995598e3d424e93fd501624ee95","v":1,"via":"run"} Ci-Attestation: {"at":1791908547,"gate":"rust/x86_64-apple-darwin/dylint","host":"linux-x86_64","key":"2c8a88faa1390454fd96d766ec27fd178374026ccafd5c9d8e289e1c0159ac4f","lane":"cross","parents":["4f8e97a441f62941d397bd8d2c491fbf1fe64c9f"],"secs":97,"stamp":"ab288d2ad0363ac0f66c618c98d1560b","tree":"beef8988a00cf995598e3d424e93fd501624ee95","v":1,"via":"run"} Ci-Attestation: {"at":1791908547,"gate":"cpp/linux-x64/tier2","host":"linux-x86_64","key":"f3e5ce43f4276979b3d102c3794d5e5d3cf77e11b042dde66bf406ec65637779","lane":"tier2-linux","parents":["4f8e97a441f62941d397bd8d2c491fbf1fe64c9f"],"secs":113,"stamp":"a63105b1bc35b9bfbc1a0e41d9afd0e7","tree":"beef8988a00cf995598e3d424e93fd501624ee95","v":1,"via":"run"}
Keep -Wundef (#595) next to -Wdouble-promotion.
MSVC rejects it (D8021). Refs #516 Local-Gate: v1 tree=ca6511f48b75a476340c1e571a25ef0a5ab2e274 secs=454 lanes=lint:run,rust-test:run,cross:run,tier2-linux:run Ci-Attestation: {"at":1791909862,"gate":"rust/all/fmt","host":"linux-x86_64","key":"f336c2ad3147e4f13dcdfd813da70fde7a394b4562bfb0faf15d4914a10f2d31","lane":"lint","parents":["504f77f1254de89022d22708a40d7194adf486b9"],"secs":19,"stamp":"4c18a2fc80688d990f2d51031a90b7b7","tree":"ca6511f48b75a476340c1e571a25ef0a5ab2e274","v":1,"via":"run"} Ci-Attestation: {"at":1791909862,"gate":"rust/x86_64-unknown-linux-gnu/clippy","host":"linux-x86_64","key":"f336c2ad3147e4f13dcdfd813da70fde7a394b4562bfb0faf15d4914a10f2d31","lane":"lint","parents":["504f77f1254de89022d22708a40d7194adf486b9"],"secs":19,"stamp":"88f44e80c3cf04f0f4d45a3a2af21813","tree":"ca6511f48b75a476340c1e571a25ef0a5ab2e274","v":1,"via":"run"} Ci-Attestation: {"at":1791909862,"gate":"rust/x86_64-unknown-linux-gnu/test","host":"linux-x86_64","key":"f65f63ede2340bea5d37ea5e45099666dba1b8c6733d0e8418fd7122bb46eb4b","lane":"rust-test","parents":["504f77f1254de89022d22708a40d7194adf486b9"],"secs":117,"stamp":"cc53ffa3c8e7038457a855e0365da80c","tree":"ca6511f48b75a476340c1e571a25ef0a5ab2e274","v":1,"via":"run"} Ci-Attestation: {"at":1791909862,"gate":"rust/x86_64-pc-windows-msvc/clippy","host":"linux-x86_64","key":"7a1e2213396afd4d3b868d4fd9390de9302e2b5377eee5e609af674f524c6b52","lane":"cross","parents":["504f77f1254de89022d22708a40d7194adf486b9"],"secs":110,"stamp":"828b7e5545900d746a01bfbf724e50a7","tree":"ca6511f48b75a476340c1e571a25ef0a5ab2e274","v":1,"via":"run"} Ci-Attestation: {"at":1791909862,"gate":"rust/x86_64-pc-windows-msvc/dylint","host":"linux-x86_64","key":"7a1e2213396afd4d3b868d4fd9390de9302e2b5377eee5e609af674f524c6b52","lane":"cross","parents":["504f77f1254de89022d22708a40d7194adf486b9"],"secs":110,"stamp":"02ffc97af301af61789386060f088bd4","tree":"ca6511f48b75a476340c1e571a25ef0a5ab2e274","v":1,"via":"run"} Ci-Attestation: {"at":1791909862,"gate":"rust/aarch64-apple-darwin/clippy","host":"linux-x86_64","key":"7a1e2213396afd4d3b868d4fd9390de9302e2b5377eee5e609af674f524c6b52","lane":"cross","parents":["504f77f1254de89022d22708a40d7194adf486b9"],"secs":110,"stamp":"5e83e862ed5525ec19dd8b67109ce0f0","tree":"ca6511f48b75a476340c1e571a25ef0a5ab2e274","v":1,"via":"run"} Ci-Attestation: {"at":1791909862,"gate":"rust/aarch64-apple-darwin/dylint","host":"linux-x86_64","key":"7a1e2213396afd4d3b868d4fd9390de9302e2b5377eee5e609af674f524c6b52","lane":"cross","parents":["504f77f1254de89022d22708a40d7194adf486b9"],"secs":110,"stamp":"c6acbd8c509755fd882c0b75a27b6098","tree":"ca6511f48b75a476340c1e571a25ef0a5ab2e274","v":1,"via":"run"} Ci-Attestation: {"at":1791909862,"gate":"rust/x86_64-apple-darwin/clippy","host":"linux-x86_64","key":"7a1e2213396afd4d3b868d4fd9390de9302e2b5377eee5e609af674f524c6b52","lane":"cross","parents":["504f77f1254de89022d22708a40d7194adf486b9"],"secs":110,"stamp":"c64c7b7851aefa10af7552b5be7661df","tree":"ca6511f48b75a476340c1e571a25ef0a5ab2e274","v":1,"via":"run"} Ci-Attestation: {"at":1791909862,"gate":"rust/x86_64-apple-darwin/dylint","host":"linux-x86_64","key":"7a1e2213396afd4d3b868d4fd9390de9302e2b5377eee5e609af674f524c6b52","lane":"cross","parents":["504f77f1254de89022d22708a40d7194adf486b9"],"secs":110,"stamp":"22ad48bcfa6725c9c7b69cc491e12029","tree":"ca6511f48b75a476340c1e571a25ef0a5ab2e274","v":1,"via":"run"} Ci-Attestation: {"at":1791909862,"gate":"cpp/linux-x64/tier2","host":"linux-x86_64","key":"2aa1c3c3f171ad58bf0576947cfe056ff79face97faa469d6b0b6f5f57e2abcb","lane":"tier2-linux","parents":["504f77f1254de89022d22708a40d7194adf486b9"],"secs":207,"stamp":"5cbdc9ada6f09edb005f4918895c5e95","tree":"ca6511f48b75a476340c1e571a25ef0a5ab2e274","v":1,"via":"run"}
zackees
added a commit
that referenced
this pull request
Oct 13, 2026
Keep -Wdouble-promotion (#596) next to -Wcast-qual. Local-Gate: v1 tree=0bbb64ed32c5fcf6044ecf3f92435d21ccaaaf16 secs=425 lanes=lint:run,rust-test:run,cross:run,tier2-linux:run Ci-Attestation: {"at":1791911919,"gate":"rust/all/fmt","host":"linux-x86_64","key":"7f9da3fb9017edef286335bffa1d9e4fe1c15abe537ff989e6ad05cfa848500c","lane":"lint","parents":["b42f1d3e5314af54cab3a3f03209515f7424020e","3006f659b244308694b501d26511cc4b798ed44d"],"secs":18,"stamp":"6cce1725f3de19dc4ae52b53d95982a2","tree":"0bbb64ed32c5fcf6044ecf3f92435d21ccaaaf16","v":1,"via":"run"} Ci-Attestation: {"at":1791911919,"gate":"rust/x86_64-unknown-linux-gnu/clippy","host":"linux-x86_64","key":"7f9da3fb9017edef286335bffa1d9e4fe1c15abe537ff989e6ad05cfa848500c","lane":"lint","parents":["b42f1d3e5314af54cab3a3f03209515f7424020e","3006f659b244308694b501d26511cc4b798ed44d"],"secs":18,"stamp":"7e6d311f8147f8a94afa39b94a7ec167","tree":"0bbb64ed32c5fcf6044ecf3f92435d21ccaaaf16","v":1,"via":"run"} Ci-Attestation: {"at":1791911919,"gate":"rust/x86_64-unknown-linux-gnu/test","host":"linux-x86_64","key":"24e4423eb6753bc739317795997851e6a7994d6de601b4d0f056c8f6efedd75a","lane":"rust-test","parents":["b42f1d3e5314af54cab3a3f03209515f7424020e","3006f659b244308694b501d26511cc4b798ed44d"],"secs":122,"stamp":"8eb04a49a13cd57b0b8e6b71a2a7be5a","tree":"0bbb64ed32c5fcf6044ecf3f92435d21ccaaaf16","v":1,"via":"run"} Ci-Attestation: {"at":1791911919,"gate":"rust/x86_64-pc-windows-msvc/clippy","host":"linux-x86_64","key":"40222f86b035edfbccb785990a09f9c87fb6fd7182636d57024e08e12e6ecc46","lane":"cross","parents":["b42f1d3e5314af54cab3a3f03209515f7424020e","3006f659b244308694b501d26511cc4b798ed44d"],"secs":105,"stamp":"345cf770a19d3b53b6901ec77ab14454","tree":"0bbb64ed32c5fcf6044ecf3f92435d21ccaaaf16","v":1,"via":"run"} Ci-Attestation: {"at":1791911919,"gate":"rust/x86_64-pc-windows-msvc/dylint","host":"linux-x86_64","key":"40222f86b035edfbccb785990a09f9c87fb6fd7182636d57024e08e12e6ecc46","lane":"cross","parents":["b42f1d3e5314af54cab3a3f03209515f7424020e","3006f659b244308694b501d26511cc4b798ed44d"],"secs":105,"stamp":"8211539956edfda07256a7d6d7062992","tree":"0bbb64ed32c5fcf6044ecf3f92435d21ccaaaf16","v":1,"via":"run"} Ci-Attestation: {"at":1791911919,"gate":"rust/aarch64-apple-darwin/clippy","host":"linux-x86_64","key":"40222f86b035edfbccb785990a09f9c87fb6fd7182636d57024e08e12e6ecc46","lane":"cross","parents":["b42f1d3e5314af54cab3a3f03209515f7424020e","3006f659b244308694b501d26511cc4b798ed44d"],"secs":105,"stamp":"2504cc910d8acecd09927ffe21bc7ef3","tree":"0bbb64ed32c5fcf6044ecf3f92435d21ccaaaf16","v":1,"via":"run"} Ci-Attestation: {"at":1791911919,"gate":"rust/aarch64-apple-darwin/dylint","host":"linux-x86_64","key":"40222f86b035edfbccb785990a09f9c87fb6fd7182636d57024e08e12e6ecc46","lane":"cross","parents":["b42f1d3e5314af54cab3a3f03209515f7424020e","3006f659b244308694b501d26511cc4b798ed44d"],"secs":105,"stamp":"4fa5ad43cff7613abbf9753dad5c3b78","tree":"0bbb64ed32c5fcf6044ecf3f92435d21ccaaaf16","v":1,"via":"run"} Ci-Attestation: {"at":1791911919,"gate":"rust/x86_64-apple-darwin/clippy","host":"linux-x86_64","key":"40222f86b035edfbccb785990a09f9c87fb6fd7182636d57024e08e12e6ecc46","lane":"cross","parents":["b42f1d3e5314af54cab3a3f03209515f7424020e","3006f659b244308694b501d26511cc4b798ed44d"],"secs":105,"stamp":"b07b982da37d241df3045cc174cc61c6","tree":"0bbb64ed32c5fcf6044ecf3f92435d21ccaaaf16","v":1,"via":"run"} Ci-Attestation: {"at":1791911919,"gate":"rust/x86_64-apple-darwin/dylint","host":"linux-x86_64","key":"40222f86b035edfbccb785990a09f9c87fb6fd7182636d57024e08e12e6ecc46","lane":"cross","parents":["b42f1d3e5314af54cab3a3f03209515f7424020e","3006f659b244308694b501d26511cc4b798ed44d"],"secs":105,"stamp":"04f832ea0e681ef2575dd2391d3ffe35","tree":"0bbb64ed32c5fcf6044ecf3f92435d21ccaaaf16","v":1,"via":"run"} Ci-Attestation: {"at":1791911919,"gate":"cpp/linux-x64/tier2","host":"linux-x86_64","key":"b3b5e40de191b1b3fca1278f888afa122137e03e54c4df5ed5476c581aba957e","lane":"tier2-linux","parents":["b42f1d3e5314af54cab3a3f03209515f7424020e","3006f659b244308694b501d26511cc4b798ed44d"],"secs":179,"stamp":"04eb2570398e46dcdb3049593dea4580","tree":"0bbb64ed32c5fcf6044ecf3f92435d21ccaaaf16","v":1,"via":"run"}
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.
Next ratchet of #516. RED commit adds -Wdouble-promotion (GCC C and clang C); GREEN commit fixes violations with explicit (double) casts, keeping float math in float and values identical (also M_PI/2.0f -> M_PI/2.0, same value, in the balance sine-law).
Exempted: cmocka tests (directory-level -Wno-double-promotion; existing C tests are never edited) and the obslua/obspython SWIG targets (generated code).
Caveat: Windows/macOS-only C files could not be compiled here; only mac-videotoolbox encoder.c was fixed by grep.
Refs #516