public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/110051] New: error: writing 1 byte into a region of size 0
@ 2023-05-31  8:05 pkurash at cern dot ch
  2023-05-31  8:56 ` [Bug c++/110051] " rguenth at gcc dot gnu.org
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: pkurash at cern dot ch @ 2023-05-31  8:05 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=110051

            Bug ID: 110051
           Summary: error: writing 1 byte into a region of size 0
           Product: gcc
           Version: 13.1.1
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: pkurash at cern dot ch
  Target Milestone: ---

Created attachment 55220
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=55220&action=edit
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).

^ permalink raw reply	[flat|nested] 5+ messages in thread

* [Bug c++/110051] error: writing 1 byte into a region of size 0
  2023-05-31  8:05 [Bug c++/110051] New: error: writing 1 byte into a region of size 0 pkurash at cern dot ch
@ 2023-05-31  8:56 ` rguenth at gcc dot gnu.org
  2023-05-31  9:39 ` redi at gcc dot gnu.org
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 5+ messages in thread
From: rguenth at gcc dot gnu.org @ 2023-05-31  8:56 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=110051

Richard Biener <rguenth at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |diagnostic

--- Comment #1 from Richard Biener <rguenth at gcc dot gnu.org> ---
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.

^ permalink raw reply	[flat|nested] 5+ messages in thread

* [Bug c++/110051] error: writing 1 byte into a region of size 0
  2023-05-31  8:05 [Bug c++/110051] New: error: writing 1 byte into a region of size 0 pkurash at cern dot ch
  2023-05-31  8:56 ` [Bug c++/110051] " rguenth at gcc dot gnu.org
@ 2023-05-31  9:39 ` redi at gcc dot gnu.org
  2023-06-01 15:52 ` [Bug tree-optimization/110051] " pkurash at cern dot ch
  2024-02-21  0:29 ` pinskia at gcc dot gnu.org
  3 siblings, 0 replies; 5+ messages in thread
From: redi at gcc dot gnu.org @ 2023-05-31  9:39 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=110051

Jonathan Wakely <redi at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Last reconfirmed|                            |2023-05-31
             Status|UNCONFIRMED                 |WAITING
     Ever confirmed|0                           |1

--- Comment #2 from Jonathan Wakely <redi at gcc dot gnu.org> ---
(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.

^ permalink raw reply	[flat|nested] 5+ messages in thread

* [Bug tree-optimization/110051] error: writing 1 byte into a region of size 0
  2023-05-31  8:05 [Bug c++/110051] New: error: writing 1 byte into a region of size 0 pkurash at cern dot ch
  2023-05-31  8:56 ` [Bug c++/110051] " rguenth at gcc dot gnu.org
  2023-05-31  9:39 ` redi at gcc dot gnu.org
@ 2023-06-01 15:52 ` pkurash at cern dot ch
  2024-02-21  0:29 ` pinskia at gcc dot gnu.org
  3 siblings, 0 replies; 5+ messages in thread
From: pkurash at cern dot ch @ 2023-06-01 15:52 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=110051

--- Comment #3 from Felix <pkurash at cern dot ch> ---
Yes, you're right, the warning is turned to error.

Without this option the compilation runs normally

^ permalink raw reply	[flat|nested] 5+ messages in thread

* [Bug tree-optimization/110051] error: writing 1 byte into a region of size 0
  2023-05-31  8:05 [Bug c++/110051] New: error: writing 1 byte into a region of size 0 pkurash at cern dot ch
                   ` (2 preceding siblings ...)
  2023-06-01 15:52 ` [Bug tree-optimization/110051] " pkurash at cern dot ch
@ 2024-02-21  0:29 ` pinskia at gcc dot gnu.org
  3 siblings, 0 replies; 5+ messages in thread
From: pinskia at gcc dot gnu.org @ 2024-02-21  0:29 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=110051

Andrew Pinski <pinskia at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
         Resolution|---                         |INVALID
             Status|WAITING                     |RESOLVED

--- Comment #4 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
No testcase in over 6 months so closing as invalid.

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2024-02-21  0:29 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-05-31  8:05 [Bug c++/110051] New: error: writing 1 byte into a region of size 0 pkurash at cern dot ch
2023-05-31  8:56 ` [Bug c++/110051] " rguenth at gcc dot gnu.org
2023-05-31  9:39 ` redi at gcc dot gnu.org
2023-06-01 15:52 ` [Bug tree-optimization/110051] " pkurash at cern dot ch
2024-02-21  0:29 ` pinskia at gcc dot gnu.org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).