bug-commoncpp
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Raw pointers returned by public interface considered harmfull.


From: Paul Elliott
Subject: Raw pointers returned by public interface considered harmfull.
Date: Sun, 6 Jul 2003 20:45:25 -0500
User-agent: Mutt/1.4i

There are places in the public interface where raw pointers are
returned. This is bad. Raw pointers are an invitation to a memory
leak. Only experienced programmers should be allowed to use
raw pointers and then only carefully in private implementations.

Example: makeCommandOptionParse

If pointers must be returned, then some kind of managed pointer should
be used. But pointers are not proper objects and their use in a public
interface generally indicates some kind of design error, even apart
from safety concerns.


The public interface should be redone. Do it right next time.


-- 
Paul Elliott                       1(512)837-1096
address@hidden                    PMB 181, 11900 Metric Blvd Suite J
http://www.io.com/~pelliott/pme/   Austin TX 78758-3117

Attachment: pgpU5w9faMTF7.pgp
Description: PGP signature


reply via email to

[Prev in Thread] Current Thread [Next in Thread]