From: Joseph Myers <joseph@codesourcery.com>
To: Jakub Jelinek <jakub@redhat.com>
Cc: Marek Polacek <polacek@redhat.com>, <gcc-patches@gcc.gnu.org>
Subject: Re: [RFC] Add stdckdint.h header for C23
Date: Mon, 12 Jun 2023 21:51:02 +0000 [thread overview]
Message-ID: <68578b43-939-1879-9676-2ea55249a2c5@codesourcery.com> (raw)
In-Reply-To: <ZIRSdNvz+pbiUQLG@tucnak>
On Sat, 10 Jun 2023, Jakub Jelinek via Gcc-patches wrote:
> I have looked at gnulib stdckdint.h and they are full of workarounds
> for various compilers, EDG doesn't do this, clang <= 14 can't multiply
> __int128, ..., so I think the header belongs into the compiler rather
> than C library, because it would be a nightmare to maintain it there.
While C2x only has type-generic macros in this header, there's a proposal
N2868 (which didn't get consensus for C2x but may come back for a future
standard version) for additional interfaces for structure types with a
sticky overflow flag, including some functions that are expected to be
defined with external linkage as usual for library functions. So if that
gets adopted in future, we'd need to arrange to provide those library
functions with external linkage - which is mostly not something we do in
GCC, although there are a few atomic_* functions in libatomic in addition
to the __atomic_* functions underlying type-generic macros.
> What I'm struggling with is enforcing the weird restrictions
> C23 imposes on these.
It's not clear all those restrictions need to be enforced - this
definitely seems like a case of undefined behavior to provide useful
extension space, where for various of those restrictions there are unique
sensible semantics to provide if the types in question are supported.
--
Joseph S. Myers
joseph@codesourcery.com
next prev parent reply other threads:[~2023-06-12 21:51 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-06-10 10:37 Jakub Jelinek
2023-06-10 11:37 ` Jakub Jelinek
2023-06-11 14:05 ` Martin Uecker
2023-06-12 10:35 ` Eric Gallager
2023-06-12 21:51 ` Joseph Myers [this message]
2023-06-13 6:28 ` Jakub Jelinek
2023-06-13 15:10 ` Joseph Myers
2023-06-13 15:20 ` Jakub Jelinek
2023-06-13 15:45 ` Joseph Myers
2023-06-14 2:54 ` Paul Eggert
2023-06-14 6:49 ` Jakub Jelinek
2023-06-14 11:46 ` Florian Weimer
2023-06-14 14:52 ` Joseph Myers
2023-06-14 15:50 ` Zack Weinberg
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=68578b43-939-1879-9676-2ea55249a2c5@codesourcery.com \
--to=joseph@codesourcery.com \
--cc=gcc-patches@gcc.gnu.org \
--cc=jakub@redhat.com \
--cc=polacek@redhat.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;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).