From: Joseph Myers <joseph@codesourcery.com>
To: "Cristian Rodríguez" <crrodriguez@opensuse.org>
Cc: Alejandro Colomar <alx.manpages@gmail.com>,
"G. Branden Robinson" <g.branden.robinson@gmail.com>,
Jonny Grant <jg@jguk.org>, Florian Weimer <fweimer@redhat.com>,
Michael Kerrisk <mtk.manpages@gmail.com>,
linux-man <linux-man@vger.kernel.org>,
GNU C Library <libc-alpha@sourceware.org>
Subject: Re: [PATCH] Add example to rand.3
Date: Fri, 30 Dec 2022 21:08:58 +0000 [thread overview]
Message-ID: <db22324-e427-d9bb-f6ee-ec155c3ff33c@codesourcery.com> (raw)
In-Reply-To: <CAPBLoAcGH1jdcLj8piriw9d5WCiknHAf=6gBFQjJs71cYZtLxA@mail.gmail.com>
[-- Attachment #1: Type: text/plain, Size: 2358 bytes --]
On Fri, 30 Dec 2022, Cristian Rodríguez via Libc-alpha wrote:
> On Fri, Dec 30, 2022 at 3:15 PM Joseph Myers <joseph@codesourcery.com> wrote:
>
> > I expect to implement these functions in due course for glibc (not GCC,
> > since these are library functions, with the usual requirements for
> > definitions with external linkage, though most would also have inline
> > header implementations based on existing longstanding built-in functions).
>
> Unless I am seriously missing something, the compiler is required to
> provide an implementation
> of them as it is a freestanding header..right ?
"freestanding" versus "hosted" isn't the right distinction for which
component in a (compiler + library) implementation provides which pieces
any more. The actual distinction is closer to whether a feature involves
library functions (with external linkage): if it does, it belongs in the
library (glibc), whereas if a header doesn't involve such functions, it
belongs in the compiler (GCC), along with the library support (in libgcc)
for language features (i.e. library code that can be needed even by
programs that don't include any standard library header or call any
function from the standard library). My list of things to be done for C2x
in GCC includes updating the GCC documentation (standards.texi) to reflect
this: that is, to say that GCC provides the compiler part of a
freestanding or hosted implementation, and library support for language
features and headers not involving external linkage functions, to be used
together with a corresponding library implementation - not that it's a
freestanding implementation by itself.
(It wasn't quite right for C11 either; GCC provides <stdatomic.h> and
libatomic, and while there are a few atomic_* functions with external
linkage, the bulk of the operations in <stdatomic.h> are only generic
functions with no defined external-linkage functions underlying them,
while it's been documented for a long time that a corresponding library is
always needed to provided memcpy, memmove and memset as those may be
generated from use of language features without being called explicitly by
the user's code. But C2x makes it a lot more visible that the previously
documented rule of thumb for where a feature goes is no longer
appropriate.)
--
Joseph S. Myers
joseph@codesourcery.com
next prev parent reply other threads:[~2022-12-30 21:09 UTC|newest]
Thread overview: 27+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-12-26 21:50 [PATCH] Add example to rand.3 Jonny Grant
2022-12-26 22:29 ` Alejandro Colomar
2022-12-27 13:07 ` Cristian Rodríguez
2022-12-27 23:33 ` Alejandro Colomar
2022-12-28 0:00 ` G. Branden Robinson
2022-12-28 0:41 ` Alejandro Colomar
2022-12-28 12:21 ` Cristian Rodríguez
2022-12-30 18:15 ` Joseph Myers
2022-12-30 18:20 ` Alejandro Colomar
2022-12-30 18:50 ` Joseph Myers
2022-12-30 18:58 ` Alejandro Colomar
2022-12-30 19:11 ` Cristian Rodríguez
2022-12-30 21:08 ` Joseph Myers [this message]
2022-12-30 21:15 ` Internal organization of "the implementation" (was: [PATCH] Add example to rand.3) Alejandro Colomar
2022-12-30 21:50 ` Joseph Myers
2022-12-27 21:37 ` [PATCH] Add example to rand.3 Jonny Grant
2022-12-27 23:11 ` Alejandro Colomar
2022-12-28 20:51 ` Jonny Grant
2022-12-28 20:56 ` Alejandro Colomar
2022-12-28 21:03 ` Alejandro Colomar
2022-12-28 21:04 ` Alejandro Colomar
2022-12-28 21:25 ` Jonny Grant
2022-12-28 21:32 ` Alejandro Colomar
2022-12-28 21:04 ` Cristian Rodríguez
2022-12-28 21:11 ` Alejandro Colomar
2022-12-28 21:19 ` Jonny Grant
2022-12-28 21:18 ` Alejandro Colomar
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=db22324-e427-d9bb-f6ee-ec155c3ff33c@codesourcery.com \
--to=joseph@codesourcery.com \
--cc=alx.manpages@gmail.com \
--cc=crrodriguez@opensuse.org \
--cc=fweimer@redhat.com \
--cc=g.branden.robinson@gmail.com \
--cc=jg@jguk.org \
--cc=libc-alpha@sourceware.org \
--cc=linux-man@vger.kernel.org \
--cc=mtk.manpages@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox