[Bug driver/103949] gcc fails to provide a standard conforming C11 or C++17 environment even when specifying -std=c11 or -std=c++17

pinskia at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Sat Jan 8 18:48:57 GMT 2022


https://gcc.gnu.org/bugzilla/show_bug.cgi?id=103949

--- Comment #5 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
>You did not address any of the standard violating behavior concerning advertising thread support at all.

There is no standard violating behavior with respect to thread support. Again
the C/C++ standard don't say how you invoke the compiler. POSIX has a section
on that but as I mentioned that is a different story all together.

In the case of mingw, the problem is how GCC was configured:
#ifndef THREAD_MODEL_SPEC
      /* Targets that define THREAD_MODEL_SPEC need to define
         __STDCPP_THREADS__ in their config/XXX/XXX-c.c themselves.  */
      if (cxx_dialect >= cxx11 && strcmp (thread_model, "single") != 0)
        cpp_define (pfile, "__STDCPP_THREADS__=1");
#endif

Which means add -mthread will not fix the issue there. You need to get a GCC
which is configured correctly to not to be single threaded.


More information about the Gcc-bugs mailing list