[Development] Qt 5.2 header diff: QtXmlPatterns

Marc Mutz marc.mutz at kdab.com
Tue Nov 5 18:04:24 CET 2013


On Tuesday, November 05, 2013 18:00:02 Nicolás Alvarez wrote:
> 2013/11/5 Marc Mutz <marc.mutz at kdab.com>:
> > 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?
> 
> I don't think that's the case. a[b] is equivalent to *(a+b), not
> (a+b). Thus, 0[qptrdiff(data)] would be equivalent to *(null +
> qptrdiff(data)), but that's not what the diff says,

Yes, Iäve updated the commit log, cf. gerrit.



More information about the Development mailing list