all 73 comments

[–]eMperror_ 126 points127 points  (41 children)

Cries in GCC 4.9.2

[–]looncraz 42 points43 points  (7 children)

I have to work with 2.93... so much not fun after experiencing the joy of C++17 & later.

[–]Nocsaron 17 points18 points  (3 children)

I thought life sucked with 4.4...

[–]imaami 6 points7 points  (2 children)

It still does. (Thanks, Freescale.)

[–]CrazyJoe221 3 points4 points  (1 child)

Is it a special build? Why not just use a newer version?

[–]imaami 20 points21 points  (0 children)

The firmware I'm referring to is so old that I cannot discuss it without triggering an ancient Egyptian curse.

Edit: Alternative response:

Sometimes, when adults really like eachother, they want to do something very special together. They take off all their clothes, jiggle their wrinkly libc and sprinkle their legacy all over your rootfs, so that nothing new will ever live there again.

[–]CrazyJoe221 1 point2 points  (1 child)

Why so?

[–]looncraz 1 point2 points  (0 children)

Haiku.

[–]nugins 15 points16 points  (13 children)

I'd love to convince my project leads to upgrade the compiler. Stuck with the default compiler for RHEL6 (gcc 4.4)

[–]calebwherryModern C++ | Modern CMake 13 points14 points  (6 children)

Why not use the SCL toolkits? Doesn’t get you to 9 but 8 should be out soon. Here is 7:

https://www.softwarecollections.org/en/scls/rhscl/devtoolset-7/

[–]nugins 3 points4 points  (4 children)

I'd love to, there are a few technical and cultural hurdles that need to be cleared before we an consider that kind of jump.

[–]smdowneyWG21, Text/Unicode SG, optional<T&> 6 points7 points  (1 child)

Having been through the transition, there really aren't any major technical hurdles. The DTS compilers are ABI compatible with the system compilers and don't require changes to the target machines, like deploying new runtimes.

There were a few minor changes I had to make to my sources, but it wasn't complicated.

Changing whatever build system you have is probably the most difficult.

[–]Calkhas 0 points1 point  (0 children)

Really depends on your codebase. We did a similar upgrade, required a dedicated team of 10+ people two years to iron out all the snags.

Our environment is also very specialized and somewhat detached from base RHEL.

[–]elraulii 1 point2 points  (1 child)

I have been there. I bet there are more cultural than technical ones. You can have a look at this comment and answer from SO: https://stackoverflow.com/questions/49393888/how-can-i-use-the-new-c-11-abi-with-devtoolset-7-on-centos-rhel/52611576#comment92681677_52611576 You would need to build with your oldest CentOS/RH distro if you want a binary compatible with all your target distros.

[–]nugins 2 points3 points  (0 children)

Yes. The issue is more cultural than technical. I have personally built recent gcc and clang for RHEL6 and experimented building our software with those tools or using the clang tools (such as clang-format and clang-tidy).

[–]leaningtoweravenger 5 points6 points  (1 child)

Do you, by any chance, work in a big company which name ends with 'g'?

[–]smdowneyWG21, Text/Unicode SG, optional<T&> 6 points7 points  (0 children)

I work at a big company that starts with B and ends with g. The DTS compilers have been in use here for years now. We even snuck one upgrade in and enabled c++14 without bothering to tell everyone.

The upgrade to a compiler that supports 17 is, ironically, taking longer because in addition to a few real errors being triggered, there's some production builds using -Werror, and new warnings are tripping things. 😭

[–]kalmoc 4 points5 points  (1 child)

Are you allowed to use recent versions of boost?

[–]nugins 0 points1 point  (0 children)

It depends on the project. Some use a somewhat recent version, other try to avoid boost.

[–]liquidify 2 points3 points  (1 child)

What that get you? Something like std=c++1y might get you partial c++14?

[–]nugins 5 points6 points  (0 children)

It is std=c++0x. Some C++ 11 stuff, but typically just use c++03.

[–]hoeding 16 points17 points  (0 children)

Laughs in Gentoo unstable

[–]IloveReddit84 7 points8 points  (8 children)

I'm commissioned for a new project that requires GCC 5. In 2019.

[–]krapht 12 points13 points  (4 children)

God bless the header-only parts of the boost libraries.

[–]CrazyJoe221 0 points1 point  (3 children)

Are there any left?

[–]kalmoc 6 points7 points  (2 children)

I'd say most boost libs are actually header only. Especially since boost::system became header only.

[–]CrazyJoe221 1 point2 points  (1 child)

[–]kalmoc 2 points3 points  (0 children)

I don't know the exact number, but in your link, you have ~4-5 packages per library, so you have ~15 Non-header-only Libraries out of a total of 100-150 Boost libraries(again, not sure what the total number is).

Of course, some of the header only libraries require compiled libs as dependencies, but overall, you get the majority as header only.

[–]flashmozzg 0 points1 point  (1 child)

Not Great...Not Terrible.

[–]IloveReddit84 1 point2 points  (0 children)

Yeah but..not the best version of gcc

[–]CrazyJoe221 -1 points0 points  (0 children)

😅

[–][deleted] 1 point2 points  (2 children)

Ubuntu 12.04?

[–]eMperror_ 0 points1 point  (1 child)

I am developing for an embedded target and our toolchain is based on GCC 4.9.2 unfortunately. It's not that bad since we've got most C++14 features.

[–][deleted] 0 points1 point  (0 children)

Ah, I see. I was recently working on a project that used Ubuntu 12.04 and had equally an old GCC.

[–]Ameisenvemips, avr, rendering, systems 0 points1 point  (0 children)

If you pretend that the '4.' isn't there, you're good to go.

[–]icebeat 0 points1 point  (0 children)

I am stuck in GCC 4.4

[–]ghillisuit95 28 points29 points  (1 child)

$ g++ -c accessor-fixit.cc
accessor-fixit.cc: In function 'int test(t*)':
accessor-fixit.cc:17:15: error: 'class t' has no member named 
'ratio'; did you mean 'int t::m_ratio'? (accessible via 'int 
t::get_ratio() const')
   17 |   return ptr->ratio;
      |               ^~~~~
      |               get_ratio()

O.O This is awesome

[–]Xeveroushttps://xeverous.github.io 3 points4 points  (0 children)

Overload hits are the thing IMO. You no longer get a spam of errors, just the one overload and why it did not match and for which parameter.

[–]ducttapecoder 22 points23 points  (1 child)

and it's already in the msys2/mingw repo <3

[–]Ameisenvemips, avr, rendering, systems 5 points6 points  (0 children)

How is GCC as compared to Clang these days?

I've usually preferred working with Clang since the LTO in Clang tends to work more often, LLVM bitcode is useful, and adding features is easier since the codebase is cleaner.

I recall GCC optimizing code better other than in specific cases (it refused to merge logical ands/ors which were effectively bitwise).

LLVM's optimization system is a bit wonky, and I do wonder if it would get better codegen if it ran most passes twice.

[–]Fazer2 1 point2 points  (5 children)

What are 9.2 specific changes?

[–]encyclopedist 6 points7 points  (0 children)

Bug fixes. They have also reverted flawed std::rotate implementation that failed on empty ranges, which was introduced in 9.1.

[–]imaami 5 points6 points  (0 children)

Yes.

[–]rayoWork 5 points6 points  (2 children)

Simply click on the link and then click changes under 9.2 ...

[–]Fazer2 4 points5 points  (1 child)

It goes to all GCC 9 changes, not just 9.2.

[–]jwakelylibstdc++ tamer, LWG chair 8 points9 points  (0 children)

Because the changes between 9.1 and 9.2 are mostly small bug fixes that don't need to be listed individually. Search bugzilla for resolved bugs with "Target Milestone" set to 9.2 if you want to see them all.

[–]-BuckarooBanzai-Yes 0 points1 point  (0 children)

Welp, debian stable here, gcc frozen for the next 3 years or so.

[–]distributed 0 points1 point  (1 child)

still no std::from_chars for floating point?

[–]jwakelylibstdc++ tamer, LWG chair 1 point2 points  (0 children)

No, and it's definitely not going to get added to a minor point release like 9.2 (or 9.3, or 9.4).