Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 29 Jan 1999 11:52:38 -0800 (PST)
From:      Matthew Dillon <dillon@apollo.backplane.com>
To:        Bruce Evans <bde@zeta.org.au>
Cc:        brian@Awfulhak.org, cvs-all@FreeBSD.ORG, cvs-committers@FreeBSD.ORG
Subject:   Re: cvs commit: src/sys/sys kernel.h
Message-ID:  <199901291952.LAA80774@apollo.backplane.com>
References:   <199901291349.AAA06463@godzilla.zeta.org.au>

next in thread | previous in thread | raw e-mail | index | archive | help
:
:You can do that anyway by casting away the const.  Don't do that.
:
:>The prototype is doubly wrong because there's no correct way to write
:>the function - not without casting the const char * to a char *.
:
:There is no problem with implementing strchr(), only a minor problem
:with its use.  Casting the const char * to char * is a correct way of
:implementing it.
:
:A similar problem with the strtoul() family was "fixed" by breaking
:the kernel versions to take a `const char **endptr' instead of a
:`char *endptr' and propagating the breakage to all callers.  This
:should be backed out.  The warning can be avoided using a union hack.
:
:Bruce

    This is a good example of how const propogation can break down.
    The real solution, at least for the kernel, is to leave the function
    as-is but possibly rename it, or provide two functions: one that
    is passed and returns a const char *, and on that doesn't.

					-Matt

					Matthew Dillon 
					<dillon@backplane.com>

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



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199901291952.LAA80774>