2

I have tried looking into relevant sources, everybody says that they support C11, but when I try to compile or research whether is supported, I get nothing or two year old responses that it is not yet implemented.

Maybe someone has more insight on this?

I'm talking about C11 standard and native implementation.

Dvole
  • 5,725
  • 10
  • 54
  • 87
  • Wouldn't that be provided by the C library, not the compiler? – Jonathan Wakely Oct 12 '15 at 13:02
  • @JonathanWakely this might be correct, I am sorry if this is incorrect question, since I'm looking for answer and I thought it is done by compiler authors – Dvole Oct 12 '15 at 13:03
  • 2
    First result on google for `gcc C11`: https://gcc.gnu.org/wiki/C11Status : `Threading [Optional] : Library issue (not implemented)` – Pixelchemist Oct 12 '15 at 13:06
  • @JonathanWakely: The C standard library is part of the implementation. And some features need compiler support. – too honest for this site Oct 12 '15 at 13:27
  • 1
    @Pixelchemist You should post that as the answer to the question. (Damn, this Google thing seems pretty handy!) – Lundin Oct 12 '15 at 13:44
  • @Olaf, but not this feature. It's modelled on pthreads, which is provided by the C library. – Jonathan Wakely Oct 12 '15 at 20:19
  • @JonathanWakely: Not sure what you mean. Strictly speaking are gcc and clang not standard compliant for a hosted environment, as they onyl supply the headers required for a _freestanding implementation_ including the optional features. They need an external standard-library which is compliant with the C library. That would be glibc for example on Linux systems. As Threading support is optional, this lib may provide its own, different threading implementation, but that would (obviously) not be the C11 threading library. (I did not even mention which was the the blueprint for the C11 library.) – too honest for this site Oct 12 '15 at 22:08
  • @JonathanWakely Yet some support is required by the compiler, e.g. the storage-class specifier `_Thread_local` and the necessary code stubs. – too honest for this site Oct 12 '15 at 22:09
  • @Olaf, the `_Thread_local` keyword is nothing to do with `` though, and I don't know what "necessary code stubs" means. What I'm saying is that the implementation status of `` "in Clang and gcc" is never going to change, it will never be implemented in clang and gcc. It will be implemented by the C library. Not clang or gcc. I have no idea what you mean by "not be the C11 threading library" ... are you saying when glibc implements `` that will not be the C11 library, because it's not part of the compiler? That's nonsense. – Jonathan Wakely Oct 12 '15 at 23:25
  • @JonathanWakely: No? It is the basis for per-thread variables. http://port70.net/~nsz/c/c11/n1570.html#7.26.1p3 . And the compiler has to generate the required code to access such variables for a function. The rest is quite what I wrote already, just rephrased. It is as much as they do not provide `stdio`, etc. Which is exactly why they are actually **not** compliant as a hosted implementation, but only a freestandandig. To repeat: they need an "external" library to provide the C standard library. – too honest for this site Oct 13 '15 at 00:58
  • For "... not be the threading library ..." Please do not just pick that part out of its context. – too honest for this site Oct 13 '15 at 01:00

0 Answers0