On Tuesday, November 05, 2013 01:07:32 Thiago Macieira wrote:
> - return (void *)qptrdiff(data);
> + char *null = 0;
> + return null + qptrdiff(data);
Since this is equivalent to
return 0[qptrdiff(data)];
isn't that dereferencing the nullptr and therefore undefined behaviour?
What's wrong with
reinterpret_cast<void*>(qptrdiff(data));
Or simply
return ptr;
which forms a union with `data`?
_______________________________________________
Development mailing list
[email protected]
http://lists.qt-project.org/mailman/listinfo/development