<table><tr><td style="">mpyne accepted this revision.<br />mpyne added a comment.<br />This revision is now accepted and ready to land.
</td><a style="text-decoration: none; padding: 4px 8px; margin: 0 8px 8px; float: right; color: #464C5C; font-weight: bold; border-radius: 3px; background-color: #F7F7F9; background-image: linear-gradient(to bottom,#fff,#f1f0f1); display: inline-block; border: 1px solid rgba(71,87,120,.2);" href="https://phabricator.kde.org/D10168">View Revision</a></tr></table><br /><div><div><p>Actually <tt style="background: #ebebeb; font-size: 13px;">-Wzero-as-null-pointer-constant</tt> is probably a good idea, and this is a correct fix. A decade ago when everything was going from 32 to 64-bits, we ran into a JuK crash bug because we used <tt style="background: #ebebeb; font-size: 13px;">GST_NULL</tt> (or similar) as the null constant for a gstreamer variadic C function, which in C++ mode was <tt style="background: #ebebeb; font-size: 13px;">0</tt>. Well, C++ didn't know that the <tt style="background: #ebebeb; font-size: 13px;">0</tt> was supposed to be a pointer instead of an <tt style="background: #ebebeb; font-size: 13px;">int</tt>, so the function in question crashed because C++ put a 32-bit <tt style="background: #ebebeb; font-size: 13px;">int</tt> on the stack instead of a 64-bit null pointer.</p>
<p>Using <tt style="background: #ebebeb; font-size: 13px;">nullptr</tt> consistently solves this issue, even though it wouldn't be a problem here since C++ can see that the <tt style="background: #ebebeb; font-size: 13px;">0</tt> is supposed to convert to a pointer.</p>
<p>The real fix should probably go in zlib, but I wouldn't hold my breath due to the compatibility requirements that I would imagine they maintain.</p></div></div><br /><div><strong>REPOSITORY</strong><div><div>R243 KArchive</div></div></div><br /><div><strong>BRANCH</strong><div><div>master</div></div></div><br /><div><strong>REVISION DETAIL</strong><div><a href="https://phabricator.kde.org/D10168">https://phabricator.kde.org/D10168</a></div></div><br /><div><strong>To: </strong>aacid, mpyne<br /><strong>Cc: </strong>mpyne, Frameworks, michaelh<br /></div>