[Insight-developers] CPPCheck Suggested Changes?
Sean McBride
sean at rogue-research.com
Thu Sep 3 17:26:43 EDT 2009
On 9/3/09 4:13 PM, kent williams said:
>Since delete 0
>and delete [] 0 are legal and harmless
True.
>it recommends not checking for 0
>before deleting.
I would agree.
>This happens so frequently in the ITK library, it looks as
>though it was done on purpose. Should I take those out, e.g.
>
>if(this->m_Something)
>{
> delete this->m_Something;
>}
>
>becomes simply
>
>delete this->m_Something;
IIRC, some crappy old compilers do not properly handle delete 0. So it
probably is deliberate.
--
____________________________________________________________
Sean McBride, B. Eng sean at rogue-research.com
Rogue Research www.rogue-research.com
Mac Software Developer Montréal, Québec, Canada
More information about the Insight-developers
mailing list