Date: Wed, 27 Jun 2001 22:57:26 +0200 From: Poul-Henning Kamp <phk@critter.freebsd.dk> To: Ben Smithurst <ben@FreeBSD.org> Cc: ru@FreeBSD.org, freebsd-doc@FreeBSD.org Subject: Re: docs/28371: malloc(2) man page correction Message-ID: <94299.993675446@critter> In-Reply-To: Your message of "Wed, 27 Jun 2001 20:45:15 BST." <20010627204515.D49799@strontium.shef.vinosystems.com>
index | next in thread | previous in thread | raw e-mail
In message <20010627204515.D49799@strontium.shef.vinosystems.com>, Ben Smithurs
t writes:
>Poul-Henning Kamp wrote:
>
>> Well, I'm not sure I agree in the fix. The string is not by
>> definition a constant, you could assign it in your code, depending
>> on circumstances found only after starting to run (for instance
>> setting "AJ" when running with a debugging command line switch).
>
>But 'extern const char *malloc_options' doesn't prevent that - it makes
>what malloc_options points to constant, not the malloc_options variable
>itself. So 'malloc_options = "AJ"' would still be legal, or did I
>misunderstand something?
But I want to be able to say:
main(...)
{
char mymallocoptions[10];
sprintf(mymallocoptions, "%c%c", something, other);
malloc_options = mymallocoptions;
}
--
Poul-Henning Kamp | UNIX since Zilog Zeus 3.20
phk@FreeBSD.ORG | TCP/IP since RFC 956
FreeBSD committer | BSD since 4.3-tahoe
Never attribute to malice what can adequately be explained by incompetence.
To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-doc" in the body of the message
home |
help
Want to link to this message? Use this
URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?94299.993675446>
