<html>
<head>
<base href="https://bugs.llvm.org/">
</head>
<body><span class="vcard"><a class="email" href="mailto:gonzalo.gadeschi@gmail.com" title="Gonzalo BG <gonzalo.gadeschi@gmail.com>"> <span class="fn">Gonzalo BG</span></a>
</span> changed
<a class="bz_bug_link
bz_status_RESOLVED bz_closed"
title="RESOLVED INVALID - std::memcpy with incorrect align attribute on arguments introduces undefined behavior"
href="https://bugs.llvm.org/show_bug.cgi?id=49708">bug 49708</a>
<br>
<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>What</th>
<th>Removed</th>
<th>Added</th>
</tr>
<tr>
<td style="text-align:right;">Status</td>
<td>REOPENED
</td>
<td>RESOLVED
</td>
</tr>
<tr>
<td style="text-align:right;">Resolution</td>
<td>---
</td>
<td>INVALID
</td>
</tr></table>
<p>
<div>
<b><a class="bz_bug_link
bz_status_RESOLVED bz_closed"
title="RESOLVED INVALID - std::memcpy with incorrect align attribute on arguments introduces undefined behavior"
href="https://bugs.llvm.org/show_bug.cgi?id=49708#c5">Comment # 5</a>
on <a class="bz_bug_link
bz_status_RESOLVED bz_closed"
title="RESOLVED INVALID - std::memcpy with incorrect align attribute on arguments introduces undefined behavior"
href="https://bugs.llvm.org/show_bug.cgi?id=49708">bug 49708</a>
from <span class="vcard"><a class="email" href="mailto:gonzalo.gadeschi@gmail.com" title="Gonzalo BG <gonzalo.gadeschi@gmail.com>"> <span class="fn">Gonzalo BG</span></a>
</span></b>
<pre><a href="https://eel.is/c++draft/expr.static.cast#13">https://eel.is/c++draft/expr.static.cast#13</a> states
<span class="quote">>If the original pointer value represents the address A of a byte in memory and A does not satisfy the alignment requirement of T, then the resulting pointer value is unspecified.</span >
So the behavior of `(int*)char_ptr` is unspecified, since that's equivalent to
`static_cast<int*>(static_cast<void*>(char_ptr))` and char_ptr does not satisfy
the alignment requirement of `int`.
Closing as non-bug. Thanks.</pre>
</div>
</p>
<hr>
<span>You are receiving this mail because:</span>
<ul>
<li>You are on the CC list for the bug.</li>
</ul>
</body>
</html>