D10168: Use nullptr for passing a null pointer to crc32

Michael Pyne noreply at phabricator.kde.org
Tue Mar 6 02:13:31 UTC 2018


mpyne accepted this revision.
mpyne added a comment.
This revision is now accepted and ready to land.


  Actually `-Wzero-as-null-pointer-constant` 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 `GST_NULL` (or similar) as the null constant for a gstreamer variadic C function, which in C++ mode was `0`.  Well, C++ didn't know that the `0` was supposed to be a pointer instead of an `int`, so the function in question crashed because C++ put a 32-bit `int` on the stack instead of a 64-bit null pointer.
  
  Using `nullptr` consistently solves this issue, even though it wouldn't be a problem here since C++ can see that the `0` is supposed to convert to a pointer.
  
  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.

REPOSITORY
  R243 KArchive

BRANCH
  master

REVISION DETAIL
  https://phabricator.kde.org/D10168

To: aacid, mpyne
Cc: mpyne, #frameworks, michaelh
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/kde-frameworks-devel/attachments/20180306/64a41c15/attachment.html>


More information about the Kde-frameworks-devel mailing list