3 ms·
GCC, Clang, and MSVC all still duplicate c* header definitions into the global namespace by default as far as I'm aware. In fact, the last time I checked, the
by Calavar 4y ago
GCC, Clang, and MSVC all still duplicate c* header definitions into the global namespace by default as far as I'm aware.
In fact, the last time I checked, the MSVC cstdio header was implemented more or less like this:
namespace std {
#include <stdio.h>
}
using namespace std;
It's kind of crazy how major compilers have been ignoring the standard for so long that people consider a standard compliant compiler to be weird and broken.
- Forricide 4y ago> It's kind of crazy how major compilers have been ignoring the standard for so long that people consider a standard compliant compiler to be weird and broken. I had absolutely no idea this wasn't even supposed to be the case (although I was aware of the duplication in std::). Guess it makes sense that the standard would shy away from global namespace pollution - I suppose one of the compilers perhaps did this for long enough that the others ended up duplicating it to increase code compatibility?
- gpderetta 4y agoThat the as actually not conforming. It was made conforming in c++11 because it was pointless to have the standard say something that all major implementations would ignore.