News for hackers. Stuff that matters.
Re:C++20, How Hard Could It Be by jmillikin on Sunday September 25, 2022 @08:31AM (#32970707)
When I was going to university the computer science department's primary system had two compilers available, GCC 2.96[0] and TenDRA. GCC was generally more popular but it didn't have std::string and any code that threw an exception would crash, so adventurous students would use TenDRA for development.

One of the stranger behaviors of TenDRA was that it put all standard library symbols, including the C headers, into namespace std. A hello world in TenDRA looked like this:

  #include <cstdio> // no <stdio.h> available

  int main() {
    std::printf("Hello, world!\n");
    return 0;
  }
It was not glorious. If anything ... the opposite. When TenDRA deigned to compile your program it would generally work (excepting bugs in the code itself), but getting it to accept any sort of third-party code was impossible because of the std namespace thing.

I ended up writing a bunch of utilities for strings, including a unit testing library that spawned each test as a subprocess (to avoid exceptions) just so I could use GCC instead.

[0] There is no such version recorded on the GNU project website.

Re:C++20, How Hard Could It Be by Sharlin on Sunday September 25, 2022 @09:15AM (#32971006)
C symbols are supposed to be in std if you use the cstdio style headers. It’s just that for a very long time compilers put them into the global namespace too.
Re:C++20, How Hard Could It Be by Calavar on Sunday September 25, 2022 @10:54AM (#32971900)
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.
Re:C++20, How Hard Could It Be by Forricide on Sunday September 25, 2022 @11:15AM (#32972123)
> 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?

Re:C++20, How Hard Could It Be by gpderetta on Sunday September 25, 2022 @05:53PM (#32976736)
That 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.
Re:C++20, How Hard Could It Be by yyyk on Sunday September 25, 2022 @08:47AM (#32970793)
>There is no such version recorded on the GNU project website.

It's sort-of recorded. It's not in the version list since there wasn't a release, just distros making a mess:

https://gcc.gnu.org/gcc-2.96.html

Re:C++20, How Hard Could It Be by jdougan on Sunday September 25, 2022 @08:40AM (#32970750)
GCC 2.96 was a development version that incorrectly got released by Redhat on Redhat 7 (and possibly other distros).

https://gcc.gnu.org/legacy-ml/gcc-announce/2000/msg00003.htm...

Re:C++20, How Hard Could It Be by jmillikin on Sunday September 25, 2022 @09:17AM (#32971029)
This was on a DEC Tru64 system, very far from any sort of Linux.

My personal suspicion is that someone (student or faculty) got their hands on a CVS snapshot and installed it system wide. That's the only explanation I can think of for it being so broken.

Re:C++20, How Hard Could It Be by alternatetwo on Sunday September 25, 2022 @03:59PM (#32975412)
Fairly sure some PS2 SDKs also shipped GCC 2.96, which is why I know this tidbit of info.
Re:C++20, How Hard Could It Be by tolciho on Sunday September 25, 2022 @10:17AM (#32971578)
2.96 exists, at least in the RedHat world.

    $ rpm -qi gcc
    Name        : gcc                          Relocations: (not relocateable)
    Version     : 2.96                              Vendor: Red Hat, Inc.
    Release     : 110                           Build Date: Fri 12 Apr 2002 10:30:47 PM UTC
    Install date: Thu 20 Jan 2011 03:34:36 AM UTC      Build Host: daffy.perf.redhat.com
    Group       : Development/Languages         Source RPM: gcc-2.96-110.src.rpm
    Size        : 8389509                          License: GPL
    Packager    : Red Hat, Inc. <http://bugzilla.redhat.com/bugzilla>
    URL         : http://gcc.gnu.org
    Summary     : The GNU cc and gcc C compilers.
    Description :
    The gcc package includes the cc and gcc GNU compilers for compiling C
    code.
    $ cat /etc/redhat-release
    Red Hat Linux release 7.3 (Valhalla)
Re:C++20, How Hard Could It Be by frutiger on Sunday September 25, 2022 @10:54AM (#32971897)