Re: incorrect use of 'pure' attribute

Arsen Arsenović <[email protected]>
Newsgroups gmane.comp.lib.gnulib.bugs
Message-ID <[email protected]>
Bruno Haible <[email protected]> writes:

> When I build packages that need the Boehm GC package, on some of my
> target machines it still needs a prior installation of the 'libatomic'
> package, because without it, the compiler's support for atomic types
> is insufficient.

Do you mean libatomic_ops?  libatomic has nothing to do with
language-level atomic operations, and it is part of GCC.

> Atomic types can't be emulated in Gnulib, because it's the compiler
> which decides which instruction sequences to use for loads and stores.

I see the simple-atomic gnulib module.  It could be extended to support
the case of relaxed load/store and used here.

> The point is portability. _Atomic was introduced in ISO C11; however,
> Gnulib assumes C99 only.

I think one should not add bugs to most systems (which can use atomic or
sync builtins, or even standard atomic operations), for sake of a few
platforms that lack any of them.

To use relaxed atomics is also not a slowdown here, unless the system
requires special operations for atomics of the corresponding size.  In
which case, not using atomics is an actualized (rather than latent) bug.

Alternatively, one could just cross their fingers on platforms lacking
stdatomic, since the odds of the bug actually manifesting observably is
quite low, and use stdatomic only a best effort basis - i.e. use it if
present, and have no atomic handling (as is the case today) otherwise.

I also doubt 'volatile' suffices (rather, I see no reason why it ought
to).
-- 
Arsen Arsenović
signature.asc (application/pgp-signature, 288 B)
-----BEGIN PGP SIGNATURE-----

iKIEARYKAEoWIQT+4rPRE/wAoxYtYGFSwpQwHqLEkwUCaniUKRsUgAAAAAAEAA5t
YW51MiwyLjUrMS4xMiwyLDIQHGFyc2VuQGFhcnNlbi5tZQAKCRBSwpQwHqLEkyCX
AP9W+4CgmmbgqHRZNh7ghFeOL6aJ5yebHB+PuqHw758DFgD9GkYHZ+oO1dPKn5HR
2y+yggruDybH2+fmSazAtPqruQA=
=wncK
-----END PGP SIGNATURE-----
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.