https://bugs.kde.org/show_bug.cgi?id=477992

Mark Wielaard <m...@klomp.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
     Ever confirmed|0                           |1
             Status|REPORTED                    |CONFIRMED
                 CC|                            |m...@klomp.org

--- Comment #5 from Mark Wielaard <m...@klomp.org> ---
(In reply to Barnabás Pőcze from comment #0)
> GCC (and apparently clang as well) specifically requires that memcpy() with
> an exact overlap does not trigger undefined behaviour
> (https://gcc.godbolt.org/z/E4rqz7bn6):
> 
> > Contrary to the standards covering memcpy GCC expects the case of an exact 
> > overlap of source and destination to work and not invoke undefined 
> > behavior. 
> 
> (from https://gcc.gnu.org/onlinedocs/gcc.pdf)

So that is from the GCC user manual, chapter 2 Language Standards Supported by
GCC, 2.1 C Language.

I haven't seen it stated so explicitly elsewhere for GCC. Do you happen to have
other references or are there any C standard DRs that address this? Asking
because a lot of references bugs seem to be unsure whether this really is the
case. It would be good if something like the above statement was made for clang
also and/or acknowledged by the C or Posix standards.

-- 
You are receiving this mail because:
You are watching all bug changes.

Reply via email to