Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

Required fields*

4
  • 6
    Yeah, I avoid extensions because I don't recommend doing anything that isn't specifically defined by the Standard... but even then, "violates" is a strange and loaded term, when a lot of these extensions are, to use Standardese, just implementation-defining or specifying things that the Standard is silent on - or perhaps even all of the extensions... Do you have a citation for any GNU extension that violates the Standard by doing something different from a thing the Standard explicitly defines? Commented Jul 5, 2016 at 0:27
  • 12
    While this answer is a good general one, would you consider editing it so as to at least list the extensions which are enabled in gnu11 but not in c++11? The list you linked to is of all extensions, and as you yourself indicate some of them are enabled with c++11 as well (like __restrict__).
    – einpoklum
    Commented Oct 4, 2016 at 8:16
  • What I found out now, and would never concluded by looking at the documentation of the flags, is the following: -std=c++11 re-enables trigraphs -std=gnu++11 ignores them and emits a warning, like it does when omitting -std alltogether
    – Daniel82
    Commented Mar 24, 2020 at 10:52
  • 1
    The best example still valid in 2022 until 2024 with Centos 7, is the <regex> library. Compiling with --std=c++11 works but the regex_match() will always return false;. People waste hours debugging something that isn't actually implemented.
    – None
    Commented Apr 27, 2022 at 2:45