Repository navigation
Fix some clang++ warnings - #610
Conversation
c9db1e5 to
8a4c528
Compare
There was a problem hiding this comment.
Thanks for the PR, it is really appreciated.
First, some context: -Weverything is not actually advised by clang.
There are a couple of changeset remarks/questions above. Other than these, there are a few others:
- the initial diff had a rather large part fixing leading underscores in some symbols; subsequently they're not here. Why the revert?
- Also, on this same subject, I think suppressing the warning as needed with file-wide push/pop is not just lower effort, but might actually be preferable. IMO there's really low risk of having these symbols clash with any other symbol.
- what are the final compile flags that you're looking to suppress? I think adding these to the CI is in order, but I'm a bit confused as to what the flags are based on the PR description and commit error messages.
- related - were there no warnings coming from c4core code? I would really expect that to be the case, but there's no PR there.
Yes, using it means you have no control over the warnings that will be enabled. Every new version of clang++ will come with new warnings. I use it as a means to enable everything in the current version of clang++ that I have - and then remove it once I've fixed everything that popped up and looked interesting enough :) Shipping a library with
I misunderstood the large impact and concentrated on just being able to compile the library clean. As it happens, CI showed that there is a lot more code that depends on those identifiers :-) I removed that commit from the set and was thinking of addressing that separately now that I have a better picture of how they are used.
True, but there are organizations that are sticklers when it comes to undefined behavior and they'd probably reject the library when noticing these identifiers. I have seen header guards and other reserved identifiers defined in libraries collide with the implementation's own identifiers after upgrading the toolchain. Not a nice surprise.
I wasn't thinking of suppressing any. Possibly adding an explicit set of warnings after having fixed those specific issues.
Oh, there were tons. Since it's in a submodule, I left those untouched. It'd probably be a good idea to go through those separately. |
My bad -- I meant fix instead of suppress. The question still stands. What are those warnings? The PR description says one thing but individual commits show another. |
Each commit is supposed to only fix the warning(s) mentioned in the four individual commit messages. For the PR, it could say "Fix clang++ warnings: -Wmissing-noreturn, -Wextra-semi, -Wextra-semi-stmt, -Wimplicit-fallthrough and -Wnrvo" but that'd require updating the PR message if I pull anything out of the set (or add anything to it). |
|
Looking at the failing windows tests : the newly-added This is triggered from an engine test that checks for an error (ie requires an error) in the specified sequence of event handler calls when using the tree handler. That test must remain. IMO the way to tackle this is to work around it by suppressing that warning it in the offending test source code: adding AFAICT these are the files where that would be needed:
HTH. |
|
The failure in the coverage workflows is unrelated with this PR, and can be ignored. It's a token access problem that must be fixed elsewhere. The install singleheader failure is a flaky test ; also unrelated. |
Signed-off-by: Ted Lyngmo <[email protected]>
This only fixes one simple case where named return value optimization was prevented. The more complicated cases are still left. Signed-off-by: Ted Lyngmo <[email protected]>
Signed-off-by: Ted Lyngmo <[email protected]>
Signed-off-by: Ted Lyngmo <[email protected]>
|
I pushed a bunch of branches before approving this run. It's going to take a while. |
|
Thanks! |
------------------------------------------------------------------------------------- azahar.mk 379649dbceaffc414311fb308d8427461683e640 # Version: Commits on Jun 05, 2026 ------------------------------------------------------------------------------------- cmake: Fix MoltenVK fetch order/library conflicts (#2183) * [cmake] Fix MoltenVK fetch order/library conflicts Rather than dealing with `find_library` shenanigans, just set the library path directly (when using bundled MoltenVK). System MoltenVK solely uses `find_library`. Avoids cache nonsense that can cause system/bundled versions to get mixed up, and overall makes the system/bundled mvk handling a lot more consistent ``` cmake -S . -B build -DUSE_SYSTEM_MOLTENVK=ON -- Using MoltenVK at /opt/homebrew/lib/libMoltenVK.dylib. cmake -S . -B build -DUSE_SYSTEM_MOLTENVK=OFF -- Using MoltenVK at /Users/crueter/code/azahar/build/externals/MoltenVK/MoltenVK/dynamic/dylib/macOS/libMoltenVK.dylib. cmake -S . -B build -DUSE_SYSTEM_MOLTENVK=ON -- Using MoltenVK at /opt/homebrew/lib/libMoltenVK.dylib. ``` Signed-off-by: crueter <[email protected]> * remove old comment Signed-off-by: crueter <[email protected]> * Cleanup --------- Signed-off-by: crueter <[email protected]> Co-authored-by: OpenSauce04 <[email protected]>, ------------------------------------------------------------------------------------------ duckstation.mk 02a41fa0637df757519ba1e0da646de61f2fceab # Version: Commits on Jun 05, 2026 ------------------------------------------------------------------------------------------ GameDB: Add metadata to `King's Field 3 - Pilot Style` (#3749), ----------------------------------------------------------------------------------- eden.mk fb6330645a06a3e0d9e6fa42a4e6f875d9ee065e # Version: Commits on Jun 05, 2026 ----------------------------------------------------------------------------------- [file_sys] Avoid crash on empty NACP language entries (#4062) -------------------------------------------------------------------------------------- flycast.mk 619082fe46577b2d99a20f2385c6d7b8dd68aed8 # Version: Commits on Jun 05, 2026 -------------------------------------------------------------------------------------- android: back to target sdk 35 (android 15) Until we figure out this fucking android 16 Back key mess. Revert 7fc81607e38de09a4be7c4b173d7adf834305826, ----------------------------------------------------------------------------------- play.mk 919f73a919a756859da1451145d89000d96540b6 # Version: Commits on Jun 01, 2026 ----------------------------------------------------------------------------------- Only split block on T/D bits if we're not on a branch. Fixes missing poly regression in Wild Arms: Alter Code F., ------------------------------------------------------------------------------------- ppsspp.mk 84677d4cb582aebb36c6541a0f1bad66a36d6647 # Version: Commits on Jun 05, 2026 ------------------------------------------------------------------------------------- Merge pull request #21788 from hrydgard/more-work GTA sprite fix: Detect sprites, clip them slightly to avoid filtering artifacts, ------------------------------------------------------------------------------------ rpcs3.mk 8112c7cc19c3a4d6ddef10572ce9f42bd928bfd7 # Version: Commits on Jun 04, 2026 ------------------------------------------------------------------------------------ Initialize rtmidi async On my system this opening the settings takes 10 seconds on a cold boot. Letting it initialize async during boot reduces this delay drastically., -------------------------------------------------------------------------------------- tsugaru.mk 177bc1a509ce8577f59abc36fdaa76a2d47814ea # Version: Commits on Jun 04, 2026 -------------------------------------------------------------------------------------- Fixed. On writing 01h to I/O 0020h (Hardware reset), only CPU was reset., ------------------------------------------------------------------------------------------- xenia-canary.mk 99fd19d02598e45121a665053c56fa46b2e06f09 # Version: Commits on Jun 05, 2026 ------------------------------------------------------------------------------------------- [XAM] Limit XContentQueryVolumeDeviceType to XContent packages - Changed mount path for XContent packages from Cdrom to Package_0 Normally it should generate specific value instead of 0, but for now 0 is enough, ----------------------------------------------------------------------------------- ymir.mk b4d9fb8d7c91421d49e9cafe7b749e0cd9920324 # Version: Commits on Jun 05, 2026 ----------------------------------------------------------------------------------- Merge pull request #892 from mmkzer0/feat/headless-dbg feat(headless): portable env, cascading dbg cfg parser and tests, ------------------------------------------------------------------------------------- ikemen.mk 843f7327efda98f6d47edbf38f45420b88cee3c8 # Version: Commits on Jun 05, 2026 ------------------------------------------------------------------------------------- style: fix code style issues with gofmt, --------------------------------------------------------------- ruffle.mk nightly-2026-06-05 # Version: Commits on Jun 05, 2026 --------------------------------------------------------------- ## What's Changed * core: Do not dispatch clip events not present in allEventFlags by @kjarosh in ruffle-rs/ruffle#23869 * Fix panic on writeback from empty CPU dirty region (prevalent in Earn to Die) by @n-raine in ruffle-rs/ruffle#23898 * avm2: Implement most of the version gating for `flash.events` classes by @Lord-McSweeney in ruffle-rs/ruffle#23836 * avm2: More minor crossbridge performance improvements by @Lord-McSweeney in ruffle-rs/ruffle#23849 * tests: add `known_failure` support to audio assertions by @moulins in ruffle-rs/ruffle#23861 * avm2: Fix setProgramConstantsFromByteArray implementation by @SuchAFuriousDeath in ruffle-rs/ruffle#23901 **Full Changelog**: ruffle-rs/ruffle@nightly-2026-06-04...nightly-2026-06-05, ----------------------------------------------------------------------------------------- rpi-eeprom.mk 114e49b9088cda026b35e5d44f7248ddedc309b2 # Version: Commits on Jun 04, 2026 ----------------------------------------------------------------------------------------- rpi-sign-bootcode: debug: Extract signature block fields For test/debug and options to extract and parse the signature blocks. Usage: Take the signed pieeprom.bin from secure-boot-recovery5 rpi-eeprom-config -x pieeprom.bin rpi-sign-bootcode -c 2712 -e bootcode.bin, ----------------------------------------------------- ecm.mk v6.27.0-rc1 # Version: Commits on Jun 02, 2026 ----------------------------------------------------- Set INTERFACE_LINK_LIBRARIES if the found library is a static library, ------------------------------------------------------- rapidyaml.mk v0.14.0 # Version: Commits on Jun 05, 2026 ------------------------------------------------------- - [PR#607](biojppm/rapidyaml#607): add file utilities: - `file_put_contents()` - `file_get_contents()` - `stdin_get_contents()` - [PR#609](biojppm/rapidyaml#609): fix misbuild in gcc 16. - [PR#610](biojppm/rapidyaml#610): fix clang warnings: `-Weverything`. Thanks @TedLyngmo ! - [PR#613](biojppm/rapidyaml#613): fix [#612](biojppm/rapidyaml#612): parse error on whitespace-only after block scalar indicators `|` or `>`: ```yaml space after: >\\space tag after: >\\t ``` - [PR#614](biojppm/rapidyaml#614) improve base64 serialization facilities: ```c++ std::string decoded; tree[ ode\] >> fmt::base64(decoded); // now possible // also can now obtain the size explicitly: substr buf = ...; size_t required = 0; tree[ ode\] >> fmt::base64(buf, &required); ``` - Update c4core to [0.4.0](https://github.com/biojppm/c4core/releases/tag/v0.4.0). ### Thanks - @TedLyngmo , ------------------------------------------------------------------------------------------ devilutionx.mk bd4ed470a82434ee1ca0e4e6c7092e414795a63e # Version: Commits on Jun 03, 2026 ------------------------------------------------------------------------------------------ Mark stash as dirty after identify/repair/recharge/oil, ------------------------------------------------------ fastfetch.mk 2.64.2 # Version: Commits on Jun 05, 2026 ------------------------------------------------------ Merge pull request #2375 from fastfetch-cli/dev Release v2.64.2, ---------------------------------------------------------------------------------------- retroarch.mk 1d5b6e0d4691682555993e9692d2909ac450cbd7 # Version: Commits on Jun 05, 2026 ---------------------------------------------------------------------------------------- Fetch translations from Crowdin, ------------------------------------------------------------------------------------------ openbor7530.mk 41fb897d4e886542173ddd6d33f3c5245e4b628d # Version: Commits on Jun 05, 2026 ------------------------------------------------------------------------------------------ Add 64-bit integer literal support to script. Consume full integer suffixes in the preprocessor lexer and parse integer constants through strtoull instead of atoi/htoi. Select VT_INTEGER, VT_INTEGER64, or VT_UINTEGER64 based on suffix and range, including signed minimum edge cases and large hexadecimal bitmasks. Update htoi as a legacy int-width helper with suffix validation and defined overflow behavior. Next step: Handling calculations., --------------------------------------------------------------------------------------- vpinball.mk 452646bbe8ee561172270583db78d96fcca0089a # Version: Commits on Jun 05, 2026 --------------------------------------------------------------------------------------- optimize SRGB565 to SRGBA path, ---------------------------------------------------------------------------------------- doomretro.mk 120ef7fc714e5fc416b0c8a5b2fac779ae18aa8f # Version: Commits on Jun 05, 2026 ---------------------------------------------------------------------------------------- Several fixes reported by Cppcheck, ------------------------------------------------------------------------------------------ xash3d-fwgs.mk 4cd6d25ee680dfc128d2817625f5e3db228248d4 # Version: Commits on Jun 05, 2026 ------------------------------------------------------------------------------------------ engine: common: account for header size when sending first file fragment (which contains filename + compressor on goldsrc), ---------------------------------------------------------------------------------------------- libretro-azahar.mk 379649dbceaffc414311fb308d8427461683e640 # Version: Commits on Jun 05, 2026 ---------------------------------------------------------------------------------------------- cmake: Fix MoltenVK fetch order/library conflicts (#2183) * [cmake] Fix MoltenVK fetch order/library conflicts Rather than dealing with `find_library` shenanigans, just set the library path directly (when using bundled MoltenVK). System MoltenVK solely uses `find_library`. Avoids cache nonsense that can cause system/bundled versions to get mixed up, and overall makes the system/bundled mvk handling a lot more consistent ``` cmake -S . -B build -DUSE_SYSTEM_MOLTENVK=ON -- Using MoltenVK at /opt/homebrew/lib/libMoltenVK.dylib. cmake -S . -B build -DUSE_SYSTEM_MOLTENVK=OFF -- Using MoltenVK at /Users/crueter/code/azahar/build/externals/MoltenVK/MoltenVK/dynamic/dylib/macOS/libMoltenVK.dylib. cmake -S . -B build -DUSE_SYSTEM_MOLTENVK=ON -- Using MoltenVK at /opt/homebrew/lib/libMoltenVK.dylib. ``` Signed-off-by: crueter <[email protected]> * remove old comment Signed-off-by: crueter <[email protected]> * Cleanup --------- Signed-off-by: crueter <[email protected]> Co-authored-by: OpenSauce04 <[email protected]>, ---------------------------------------------------------------------------------------------- libretro-brimir.mk 50b4083ef06a17d453ddc7a5a1caa853d80697be # Version: Commits on Jun 05, 2026 ---------------------------------------------------------------------------------------------- gitignore: add codewhale directory, -------------------------------------------------------------------------------------------- libretro-dice.mk d9cc6c4867453cab45f397cd17a217d988de4864 # Version: Commits on Jun 05, 2026 -------------------------------------------------------------------------------------------- Fetch translations & Recreate libretro_core_options_intl.h, ---------------------------------------------------------------------------------------------- libretro-ecwolf.mk af987aaa88284a3184413810eb0dd11b070a20de # Version: Commits on Jun 04, 2026 ---------------------------------------------------------------------------------------------- thingdef: declare backported actions as native (fixes halo lighting) The backported DECORATE actions had C++ implementations registered via ACTION_FUNCTION, but no matching 'action native' declarations in the base Actor class (actors/native.txt). FindFunction only resolves actions that were declared native on a class (or its parents), so for these functions it returned NULL: the parser silently dropped the action call, leaving the frame's action pointer null. A_EnableHaloLight therefore never ran, haloLightMask stayed 0, no halos were ever activated, and the LZWolf halo lighting never rendered despite the halolight properties parsing correctly. Declare the seven backported actions in the base Actor native block: A_EnableHaloLight, A_EnableZoneLight, A_MirrorPosition, A_ResetPosition, A_SelectWeapon, A_SetHealth, A_StartMusic. Signatures and defaults match the ACTION_PARAM usage in each implementation. native.txt lives in the embedded base data (ecwolf.pk3), so regenerate ecwolf_pk3_data.c from the rebuilt pk3 (only actors/native.txt changed; all other entries byte-identical). Verified with a headless libretro harness driving the real core into the HD mod's first map: the lamp actors go from haloLightMask=0 / 0 active halos to all 38 masked with 240 active halo instances populated each frame, so the glow now renders., ----------------------------------------------------------------------------------------------- libretro-flycast.mk 619082fe46577b2d99a20f2385c6d7b8dd68aed8 # Version: Commits on Jun 05, 2026 ----------------------------------------------------------------------------------------------- android: back to target sdk 35 (android 15) Until we figure out this fucking android 16 Back key mess. Revert 7fc81607e38de09a4be7c4b173d7adf834305826, ------------------------------------------------------------------------------------------------ libretro-gambatte.mk 6716e6ee39c2abd3ea325f66fb26e7f866f4c5dc # Version: Commits on Jun 05, 2026 ------------------------------------------------------------------------------------------------ Fetch translations & Recreate libretro_core_options_intl.h, ---------------------------------------------------------------------------------------------------- libretro-parallel-n64.mk 35ad6a20a7bc12976e0297307b9b4e76ac643ee4 # Version: Commits on Jun 05, 2026 ---------------------------------------------------------------------------------------------------- rom_luts: fix the in-game save freeze in Super Mario 64 60fps V2 Selecting 'SAVE & CONTINUE' after collecting a star froze the hack on every CPU core: video stopped, input died, audio kept playing. The save thread wrote its EEPROM status-probe block to the PIF (the lone SI write DMA in the whole trace) and then slept in osRecvMesg forever, while the rest of the OS - audio, VI, the per-frame controller polls - carried on normally. The hack's 60fps controller polling bypasses libultra's SI access arbitration: read-only PIF polls keep flowing every frame even while another thread has an EEPROM transaction in flight, which stock osContStartReadData/__osSiGetAccess serialization would never allow. With g_delay_si's delayed completion there is a window between the EEPROM write DMA and its SI interrupt in which a poll can interleave, and the save thread's completion event is lost to the racing poller. Real hardware resolves the same race in the game's favor. Deliver SI DMA completion immediately for this title, the same lut_delaysi treatment the Banjo games already get, which closes the window; the hack's CRC also joins the older 60fps hack in lut_ee4k. Verified from the savestate at the save prompt: the save completes and the game proceeds to the post-star dialog on ari64, hacktarux and the pure interpreter, the hack still boots from power-on to the file select screen, and vanilla SM64's 240-frame RAM-hash trace is unchanged., ---------------------------------------------------------------------------------------------- libretro-ppsspp.mk 9506f5c4700352408c8728f7800a534e13321b0e # Version: Commits on Jun 05, 2026 ---------------------------------------------------------------------------------------------- Merge pull request #21791 from hrydgard/compat-info Add a debug window to check active compat flags, ---------------------------------------------------------------------------------------------- libretro-prboom.mk 88cdd7787f6af75776090a2ff2fc03f5c5b66af9 # Version: Commits on Jun 05, 2026 ---------------------------------------------------------------------------------------------- heretic: per-sound concurrent channel cap Vanilla heretic limits how many instances of one sound type may play at once -- most sounds to two, ambients to one -- via the sfxinfo numchannels field, evicting the least important running instance at the cap or dropping the new sound when every running instance outranks it (heretic priorities ascend). The fork's reduced sfxinfo dropped the field entirely, so a burst of one sound, a crowd of gargoyles or a volley of wand hits, stacked without limit where vanilla collapses it to the cap. sfxinfo_t regains numchannels as a trailing member, so the doom and hexen tables' initializers leave it zero, meaning uncapped, and nothing else changes for those games. The heretic table's values are ported per sound from dsda-doom by name: 108 sounds cap at two, 16 at one, the rest unlimited. S_StartSoundAtVolume applies vanilla's check before channel allocation, comparing raw table priorities among instances of the same sound, and each claimed engine channel now records its priority for that comparison. Verified in a headless harness on retail HERETIC.WAD: a burst of six simultaneous gold-wand hits from six distinct origins allocates two channels and logs four cap evictions, holding the vanilla steady state of two concurrent instances. 2500-frame chaos-input soaks of both raven games complete under valgrind with zero errors., ---------------------------------------------------------------------------------------------- libretro-stella.mk 3dc82887963087dccb69ec77ec91d025879176d0 # Version: Commits on Jun 05, 2026 ---------------------------------------------------------------------------------------------- Tentative fix for #548, --------------------------------------------------------------------------------------------- libretro-wasm4.mk 5b05a016c19a94047294cc927ffff0df2d68e1fe # Version: Commits on Jun 05, 2026 --------------------------------------------------------------------------------------------- Merge pull request #865 from yamt/toywasm-75 bump toywasm to v76,
Compiled with
-Weverything -Wno-c++98-compat -Wno-c++98-compat-pedanticand fixed some low hanging fruits.