Skip to content

Conversation

@ninetailedtori
Copy link

both gcc and clang pass this flag through to linker, so this is for greater compatibility as well.

Both clang and gcc pass this directly to linker anyway.

Signed-off-by: ninetailedtori <[email protected]>
@ninetailedtori ninetailedtori changed the title Move -s (strip symtab) to linker Add support for building with Clang (includes bump to C++20). Dec 8, 2025
@ninetailedtori
Copy link
Author

Bump to C++20 needed so that Clang can go with -Wpedantic due to the issue of -Wgnu-zero-variadic-macro-arguments, which is only solvable in C++20 with the addition of __VA_OPTS__.

@shdwmtr
Copy link
Member

shdwmtr commented Dec 8, 2025

Clang support is definitely a good idea, thanks!

However, regarding C++ 20, I'd personally prefer to stay on C++17 as I'd technically have to document the migration as a breaking change (as those who compile from source may need a different/updated version of their compiler) which I prefer to avoid. Is it possible without updating to C++20?

@ninetailedtori
Copy link
Author

I'd have to use a macro hack that expands based on count of variadics, I think? Lemme see what I can do ;]

@ninetailedtori
Copy link
Author

Alright, there's some messy ways we could do it - if we attempt to helper function to trick preproc into believing there's always one arg, which there is but, then it'll throw an error in pedantic on variadic-arguments-omitted, which is a valid warn as there'll be a hanging comma. We can instead, define an overload to this macro, which will be my first attempt to see if that works, and that'll do until we bump to c++20, or we have to force gcc, which is messy and sorta ruins the point of this PR xD

I'll attempt the overload, but if that fails then I will rewrite the function to handle variadic unwrapping in c++ native, rather than c preproc, and I'll migrate the code to using that safely instead ( which is technically the best safe solution, just a teeny bit less speed if I don't optimise it right but I'll make sure to optimise it well :] )

@ninetailedtori
Copy link
Author

But I've cloned the original c++20 migration as well so we have a backup once we do bump to it, so we can revert to speedy preproc (unless I work out a genius native solution, I'll try my best xD)

…structor (implicitly defined, unnecessary and destroys the implicit copy operator when compiling with pedantic warnings on newer compilers.
@ninetailedtori
Copy link
Author

Alright, I've force pushed a change for this - replaces the entire commit history with a change to VA_ARGS expansion, as well as remove user-defined copy constr for the implicit copy constr which is exactly the same (improves compatibility with strict and pedantic errors, because it throws an error that you've defined one and it's replaced the user-defined copy operator as well).

@ninetailedtori ninetailedtori changed the title Add support for building with Clang (includes bump to C++20). Support for Clang compiler (unwrap variadic arguments), fix code errors thrown by -Wpedantic. Dec 8, 2025
@shdwmtr shdwmtr merged commit a801878 into SteamClientHomebrew:next Dec 9, 2025
@ninetailedtori ninetailedtori deleted the linker-strip-flag branch December 9, 2025 15:50
@github-actions
Copy link

🎉 This PR is included in version 2.31.0-beta.5 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants