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

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

Closed
asidorov9 opened this issue Oct 8, 2024 · 2 comments

Comments

@asidorov9
Copy link

g++ 14.2.0

#include <filesystem>
#include <fmt/std.h>

int main()
{
	fmt::print("{}\n", std::filesystem::current_path());
	return 0;
}

g++ main.cpp -lfmt -O3

                 from /usr/local/include/fmt/std.h:11,
                 from main.cpp:2:
In function ‘constexpr OutputIt fmt::v11::detail::copy(InputIt, InputIt, OutputIt) [with T = char; InputIt = const char*; OutputIt = char*; typename std::enable_if<(! is_back_insert_iterator<OutputIt>::value), int>::type <anonymous> = 0]’,
    inlined from ‘constexpr void fmt::v11::detail::for_each_codepoint(fmt::v11::string_view, F) [with F = code_point_index(fmt::v11::string_view, size_t)::<lambda(uint32_t, fmt::v11::string_view)>]’ at /usr/local/include/fmt/format.h:677:15,
    inlined from ‘size_t fmt::v11::detail::code_point_index(fmt::v11::string_view, size_t)’ at /usr/local/include/fmt/format.h:738:21,
    inlined from ‘constexpr OutputIt fmt::v11::detail::write(OutputIt, fmt::v11::basic_string_view<Char>, const fmt::v11::format_specs&) [with Char = char; OutputIt = fmt::v11::basic_appender<char>]’ at /usr/local/include/fmt/format.h:2284:28:
/usr/local/include/fmt/base.h:1213:31: warning: writing 8 bytes into a region of size 7 [-Wstringop-overflow=]
 1213 |   while (begin != end) *out++ = static_cast<T>(*begin++);
      |                        ~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~
@sunmy2019
Copy link
Contributor

similar issues #4125 #4133

@vitaut
Copy link
Contributor

vitaut commented Oct 8, 2024

Looks the same as #4133.

@vitaut vitaut closed this as completed Oct 8, 2024
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

3 participants