Path: csiph.com!eternal-september.org!feeder.eternal-september.org!reader01.eternal-september.org!.POSTED!not-for-mail
From: Tim Rentsch
Newsgroups: comp.std.c
Subject: Re: Making more of the C standard library mandatory for freestanding implementations
Date: Thu, 07 May 2020 06:14:48 -0700
Organization: A noiseless patient Spider
Lines: 27
Message-ID: <86k11nzy2f.fsf@linuxsc.com>
References:
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Injection-Info: reader02.eternal-september.org; posting-host="b769366f99350c90aa3bc88bc2611d43"; logging-data="28331"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+ok2zAuOCsDg2NO4NEQtR6ebenH10cxqw="
User-Agent: Gnus/5.11 (Gnus v5.11) Emacs/22.4 (gnu/linux)
Cancel-Lock: sha1:wGfVoBbX1KTY3298OXXISM/zr60= sha1:wYMGK6sojfH0BPICrwq3U9kqMSQ=
Xref: csiph.com comp.std.c:6096
Philipp Klaus Krause writes:
> In C, most of the standard library is mandatory for hosted
> implementations only, not for freestadning implementations.
> Still, I see many functions, such as memcpy() and abs() often used in
> programs for embedded systems, and see no obstacles to implementing them
> even on small systems.
>
> Should more of the standard library become mandatory for freestanding
> implementations?
>
> For string.h, I have written a first draft of a proposal:
>
> http://www.colecovision.eu/stuff/proposal-freestanding-string.html
>
> What do you think of it?
>
> Do you see any reason those could not be provided on some C implementation?
>
> Which further functions would you like to become mandatory for
> freestanding C implementations?
I second the comments of Grant Edwards and Hans-Bernhard Broeker.
Freestanding implementations may provide whatever additional
library facilities they choose, but the required set should
be kept where it is, at an absolute minimum.