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

Fix GCC 6.4.0 compilation errors #4319

Closed
wants to merge 1 commit into from

Conversation

sergiud
Copy link
Contributor

@sergiud sergiud commented Jan 20, 2025

Fixes #4318.

@@ -1213,7 +1213,7 @@ FMT_CONSTEXPR auto format_decimal(OutputIt out, UInt value, int num_digits)
return out;
}
// Buffer is large enough to hold all digits (digits10 + 1).
char buffer[digits10<UInt>() + 1];
char buffer[digits10<UInt>() + 1]{};
if (is_constant_evaluated()) fill_n(buffer, sizeof(buffer), '\0');
Copy link
Contributor Author

Choose a reason for hiding this comment

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

In case the unconditional buffer initialization is acceptable the fill_n invocations can be dropped.

@vitaut
Copy link
Contributor

vitaut commented Jan 22, 2025

Closing in favor of a different fix (41539c2) since it's a bug in gcc but thanks for the PR!

@vitaut vitaut closed this Jan 22, 2025
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.

GCC 6.4.0 compilation errors
2 participants