[llvm-bugs] [Bug 27526] Wrong optimization of sprintf

via llvm-bugs llvm-bugs at lists.llvm.org
Tue Apr 26 08:30:38 PDT 2016


https://llvm.org/bugs/show_bug.cgi?id=27526

David Majnemer <david.majnemer at gmail.com> changed:

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

--- Comment #1 from David Majnemer <david.majnemer at gmail.com> ---
GLibc contains the following:
The behavior of this function is undefined if copying takes place between
objects that overlap—for example, if s is also given as an argument to be
printed under control of the ‘%s’ conversion.

http://www.gnu.org/software/libc/manual/html_mono/libc.html#Formatted-Output-Functions

The Single Unix Specification Version 4 says the same thing:
If copying takes place between objects that overlap as a result of a call to
sprintf() or snprintf(), the results are undefined.

Therefore, I do not believe that LLVM's behavior is indicative of a bug.

-- 
You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20160426/fe2b9a10/attachment.html>


More information about the llvm-bugs mailing list