From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 36EE83858C1F; Wed, 31 May 2023 09:39:07 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 36EE83858C1F DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1685525947; bh=FX/HEhj1DjGM+57YQO4LkMj3EkrKOKpCU4rgCC0WJL0=; h=From:To:Subject:Date:In-Reply-To:References:From; b=jNmGwwOf9NMgyvzeeYLz0D8XQHz15hUeoLzbm6WLNHk5xztVqsMo/dRmjPSybD8tg 59TRo3YP/9NahQ5WQXyhFgIb4I+vv7PsaIZsVfkZlXv8clBKs0SaLwsU4tzJzpjUlw 7ex4LHcXhNc3Opqt1CCzwgTi5QAMR3lUNbY7ek2I= From: "redi at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug c++/110051] error: writing 1 byte into a region of size 0 Date: Wed, 31 May 2023 09:39:06 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: c++ X-Bugzilla-Version: 13.1.1 X-Bugzilla-Keywords: diagnostic X-Bugzilla-Severity: normal X-Bugzilla-Who: redi at gcc dot gnu.org X-Bugzilla-Status: WAITING X-Bugzilla-Resolution: X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: cf_reconfirmed_on bug_status everconfirmed Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 List-Id: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D110051 Jonathan Wakely changed: What |Removed |Added ---------------------------------------------------------------------------- Last reconfirmed| |2023-05-31 Status|UNCONFIRMED |WAITING Ever confirmed|0 |1 --- Comment #2 from Jonathan Wakely --- (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[] =3D "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 che= ck if yours is another duplicate of one of those.=