Created attachment 55220 [details] build log Hello, I am compiling some software with use of GCC, there are many errors which are not dependent on the code being compiled, since the logs seem to point at the errors in the files within /usr directory: /usr/lib/gcc/x86_64-pc-linux-gnu/13/include/g++-v13/bits/stl_algobase.h:398:17: error: writing 1 byte into a region of size 0 [-Werror=stringop-overflow=] 398 | { *__to = *__from; } | ~~~~~~^~~~~~~~~ I use Gentoo Linux, my current gcc version is 13.1.1_p20230520 which I installed with the system package manager (portage). I also attach a full log of compilation of a package (I need to build multiple packages in a chain, when I skip this one there arise similar errors at compilation process of subsequent packages).
The diagnostics are from template instantiations of the standard template library which we now consider useful to the user. They will necessarily point to implementation details of that library, a better reporting is difficult to implement.
(In reply to Felix from comment #0) > I am compiling some software with use of GCC, there are many errors which Those are warnings. You requested to turn them into errors with -Werror. > are not dependent on the code being compiled, since the logs seem to point > at the errors in the files within /usr directory: This is an incorrect assumption. If you write the following code, you'll get diagnostics pointing to the standard library code, but the bug is still in your code: char s1[] = "abcdefghij"; char s2[5]; std::copy(std::begin(s1), std::end(s1), s2); In your specific case, it might be a false positive warning. But you can't assume that just because the diagnostics show code in the std::lib. The build log is useless though. All it shows is there are some warnings, nobody can tell if they're valid or not without the code. Please read https://gcc.gnu.org/bugs again and provide the requested info. Also please search the (many!) existing bugs about -Wstringop-overflow warnings and check if yours is another duplicate of one of those.
Yes, you're right, the warning is turned to error. Without this option the compilation runs normally
No testcase in over 6 months so closing as invalid.