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

compiler warning [-Wstringop-overflow=] when formatting compiled format strings with styled args #4165

Closed
moshelooks opened this issue Sep 18, 2024 · 1 comment

Comments

@moshelooks
Copy link

I was working on a PR to add color support for compiled format strings when I hit an issue with the existing code (master) that I'm not sure how to handle. https://github.com/moshelooks/fmt adds a test that illustrates this:

fmt::format(FMT_COMPILE("x{}"), fmt::styled("foo", fmt::text_style()));

Gives warning like:

include/fmt/base.h:1981:31: warning: writing 8 bytes into a region of size 7 [-Wstringop-overflow=]

Full make output (Fedora, g++ (GCC) 14.2.1 20240801 (Red Hat 14.2.1-1)): warnings.txt. Thank you!

@vitaut
Copy link
Contributor

vitaut commented Sep 19, 2024

Same as #4133.

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

No branches or pull requests

2 participants