Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 5 Jul 2000 01:58:30 +1000 (EST)
From:      Bruce Evans <bde@zeta.org.au>
To:        Brian Fundakowski Feldman <green@FreeBSD.ORG>
Cc:        Andrzej Bialecki <abial@webgiro.com>, dfr@FreeBSD.ORG, jlemon@FreeBSD.ORG, freebsd-arch@FreeBSD.ORG
Subject:   Re: UPDATE: Re: Dynamic sysctls, next round (please review)
Message-ID:  <Pine.BSF.4.21.0007050147570.16485-100000@besplex.bde.org>
In-Reply-To: <Pine.BSF.4.21.0007040112540.45364-100000@green.dyndns.org>

next in thread | previous in thread | raw e-mail | index | archive | help
On Tue, 4 Jul 2000, Brian Fundakowski Feldman wrote:

> On Mon, 3 Jul 2000, Andrzej Bialecki wrote:

> > >  What's the point of all of the KASSERT()s against
> > > NULL?  The system will crash in either case.
> > 
> > I planned to remove them later on. Now they provide easy means of
> > identifying the cause.
> 
> It's just my anti-bloat feelings that say they shouldn't be there.  They
> don't hurt much, but they really don't help like checking for NULL
> function pointers does.  NULL data pointers are easy to debug, but NULL
> function pointers... trashing your IP is not fun :(

The caller's IP can easily be recovered from the stack.  Trashed IP's for
jumps are more interesting.

> 
> > >  Why was const removed
> > > from const char *oid_name?
> > 
> > To silence the compiler warning: it didn't like assigning and freeing
> > pointers that are const char *.

To break the compiler warning :-).  Actually to lose the protection of
declaring the string as const.  Since dynamically allocated strings aren't
const, this seems to be the least of evils.

> Silence those few warnings yourself with casts where it is necessary.  The
> const will prevent mistakes by others later, since they do _not_ have a
> reason to be modifying oid_name.

-Wcast-qual prevents breaking the warning using a cast :-).

Bruce



To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-arch" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?Pine.BSF.4.21.0007050147570.16485-100000>