This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [RFC] CHECK_TYPEDEF


On Mon, Jul 02, 2007 at 06:37:59PM -0700, Michael Snyder wrote:
> > Do you think the case of a NULL type is at all common?  I bet
> > everything that uses CHECK_TYPEDEF then looks inside the type, so if
> > we want null type checks, they'd be more useful before the
> > CHECK_TYPEDEF than inside it.
> 
> Well, I don't think checking for null falls within the definition
> of CHECK_TYPEDEF's purpose -- other than that CHECK_TYPEDEF should
> not crash.  How about this?

In my opinion, we'll mostly always use the result of CHECK_TYPEDEF;
so whether it crashes when given a bad pointer or not is immaterial
and the check is not useful.  Like the standard argument against
strlen (NULL) == 0.

That's really a matter of personal style though.  I don't have a
technical objection.

-- 
Daniel Jacobowitz
CodeSourcery


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]