Path: csiph.com!eternal-september.org!feeder.eternal-september.org!reader01.eternal-september.org!.POSTED!not-for-mail From: Keith Thompson Newsgroups: comp.std.c Subject: Re: Making more of the C standard library mandatory for freestanding implementations Date: Tue, 04 Aug 2020 07:35:00 -0700 Organization: None to speak of Lines: 36 Message-ID: <8736528oob.fsf@nosuchdomain.example.com> References: <3e5a2404-f2a9-3503-31f6-1c0040d34945@t-online.de> <878si3bjwe.fsf@nightsong.com> <86blmyzbbt.fsf@linuxsc.com> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: reader02.eternal-september.org; posting-host="8e1a0ffdbf8d1772d4a70bcdb1fd17b6"; logging-data="19398"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/CkEttuzR1RShEGSgKTgnm" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.3 (gnu/linux) Cancel-Lock: sha1:rgrikBV29rZ9AsbduAK/HLXGD64= sha1:MkEs01hhthOLUafDZ2wsMy8vzjQ= Xref: csiph.com comp.std.c:6143 Philipp Klaus Krause writes: > Am 08.05.20 um 17:38 schrieb Tim Rentsch: >> >> What I like about your idea is the notion that an interface is >> standardized, and an implementation gets a binary choice, >> either to provide it as specified, or just not to provide it. >> >> To make that idea work for case under discussion here (ie, for >> string functions), I think that needs to be augmented in two >> ways. One, it needs to be more fine grained than just all of >> . > > The current C2X draft has __STDC_VERSION_XXXX_H__, which allows to > specify the version of the standard a header conforms to. While not as > fine-grained as a per-function macro would be, it already is much more > fine-grained than the previously existing global macro for standard > version compliance. It says: Some standard headers define or declare identifiers that had not been present in previous versions of this document. To allow implementations and users to adapt to that situation, they also define a version macro for feature test of the form __STDC_VERSION_XXXX_H__ which expands to yyyymmL, where XXXX is the all-caps spelling of the corresponding header . I wonder if it would make sense to require that macro for all standard headers rather than just the ones that have changed. (A counterargument is that a program wouldn't check the value unless the programmer knows that something has changed.) -- Keith Thompson (The_Other_Keith) Keith.S.Thompson+u@gmail.com Working, but not speaking, for Philips Healthcare void Void(void) { Void(); } /* The recursive call of the void */