Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unreachable code & constexpr constructor bigint() #4388

Closed
wants to merge 2 commits into from

Conversation

jonasbhjulstad
Copy link

Proprietary, strict compiler complains about the following:

Unreachable code: certain branches in fmt/base.h are unreachable.
Fix: Add branches

Constexpr constructor constructing non-constexpr member:
Fix: make constexpr constructor default.

@vitaut
Copy link
Contributor

vitaut commented Mar 13, 2025

Thanks for the PR but fixing all possible warnings especially on compilers we don't have access to is a non-goal. I recommend suppressing the warning on your side instead.

@vitaut vitaut closed this Mar 13, 2025
@@ -542,10 +551,11 @@ template <typename Char> class basic_string_view {
size_ = __builtin_strlen(detail::narrow(s));
return;
}
#endif
#else
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is likely not a good idea because you would completely skip the strlen if Char is not a char, say a wchar_t. The better answer would involve some kind of if constexpr setup so that you have a fallback for wide chars.

Copy link
Author

@jonasbhjulstad jonasbhjulstad Mar 18, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah I noticed issues with the fix.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants