Dmitri Gribenko <[email protected]> writes:

> On Thu, Jan 10, 2013 at 9:12 PM, David Greene <[email protected]> wrote:
>> Fix casting to avoid cast-away-const errors.
>
>    ProtocolQualifiers = new Decl*[NP];
>    ProtocolLocs = new SourceLocation[NP];
> -  memcpy((void*)ProtocolQualifiers, Protos, sizeof(Decl*)*NP);
> +  memcpy(const_cast<Decl **>(ProtocolQualifiers), Protos, sizeof(Decl*)*NP);
>
> A better fix is to avoid a cast -- introduce a local variable of the
> correct type and initialize it with new Decl*[NP] here, memcpy, and
> assign to the data member after that.

Ok, I'll work on that.

Do the rest of the patches look ok?

                               -David
_______________________________________________
cfe-commits mailing list
[email protected]
http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits

Reply via email to