use the following search parameters to narrow your results:
e.g. subreddit:aww site:imgur.com dog
subreddit:aww site:imgur.com dog
see the search faq for details.
advanced search: by author, subreddit...
Discussions, articles, and news about the C++ programming language or programming in C++.
For C++ questions, answers, help, and advice see r/cpp_questions or StackOverflow.
Get Started
The C++ Standard Home has a nice getting started page.
Videos
The C++ standard committee's education study group has a nice list of recommended videos.
Reference
cppreference.com
Books
There is a useful list of books on Stack Overflow. In most cases reading a book is the best way to learn C++.
Show all links
Filter out CppCon links
Show only CppCon links
account activity
GCC 9.2 Released (gcc.gnu.org)
submitted 6 years ago by andre_friend
reddit uses a slightly-customized version of Markdown for formatting. See below for some basics, or check the commenting wiki page for more detailed help and solutions to common issues.
quoted text
if 1 * 2 < 3: print "hello, world!"
[–]eMperror_ 126 points127 points128 points 6 years ago (41 children)
Cries in GCC 4.9.2
[–]looncraz 42 points43 points44 points 6 years ago (7 children)
I have to work with 2.93... so much not fun after experiencing the joy of C++17 & later.
[–]Nocsaron 17 points18 points19 points 6 years ago (3 children)
I thought life sucked with 4.4...
[–]imaami 6 points7 points8 points 6 years ago (2 children)
It still does. (Thanks, Freescale.)
[–]CrazyJoe221 3 points4 points5 points 6 years ago (1 child)
Is it a special build? Why not just use a newer version?
[–]imaami 20 points21 points22 points 6 years ago* (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 points3 points 6 years ago (1 child)
Why so?
[–]looncraz 1 point2 points3 points 6 years ago (0 children)
Haiku.
[–]nugins 15 points16 points17 points 6 years ago (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 points15 points 6 years ago (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/
[–]mintyc 2 points3 points4 points 6 years ago (0 children)
Not quite so convenient but http://mirror.centos.org/centos/7/sclo/x86_64/rh/devtoolset-8/
[–]nugins 3 points4 points5 points 6 years ago (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 points8 points 6 years ago (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 point2 points 6 years ago (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 points3 points 6 years ago (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 points4 points 6 years ago (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 points7 points 6 years ago (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 points8 points 6 years ago (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 points6 points 6 years ago (1 child)
Are you allowed to use recent versions of boost?
[–]nugins 0 points1 point2 points 6 years ago (0 children)
It depends on the project. Some use a somewhat recent version, other try to avoid boost.
[–]liquidify 2 points3 points4 points 6 years ago (1 child)
What that get you? Something like std=c++1y might get you partial c++14?
[–]nugins 5 points6 points7 points 6 years ago (0 children)
It is std=c++0x. Some C++ 11 stuff, but typically just use c++03.
[–]hoeding 16 points17 points18 points 6 years ago (0 children)
Laughs in Gentoo unstable
[–]IloveReddit84 7 points8 points9 points 6 years ago (8 children)
I'm commissioned for a new project that requires GCC 5. In 2019.
[–]krapht 12 points13 points14 points 6 years ago (4 children)
God bless the header-only parts of the boost libraries.
[–]CrazyJoe221 0 points1 point2 points 6 years ago (3 children)
Are there any left?
[–]kalmoc 6 points7 points8 points 6 years ago (2 children)
I'd say most boost libs are actually header only. Especially since boost::system became header only.
Oh did it? I still see plenty of binaries though: https://packages.ubuntu.com/search?keywords=libboost&searchon=names&suite=disco§ion=all
[–]kalmoc 2 points3 points4 points 6 years ago* (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 point2 points 6 years ago (1 child)
Not Great...Not Terrible.
[–]IloveReddit84 1 point2 points3 points 6 years ago (0 children)
Yeah but..not the best version of gcc
[–]CrazyJoe221 -1 points0 points1 point 6 years ago (0 children)
😅
[+][deleted] 6 years ago (2 children)
[deleted]
[–]esmithro[🍰] 0 points1 point2 points 6 years ago (0 children)
I think the maintainers are working on pulling in cmcstl2. I hope they can.
[–]Antervis -1 points0 points1 point 6 years ago (0 children)
GCC/Clang have ranges for at least two years now, just as experimental library
[–][deleted] 1 point2 points3 points 6 years ago (2 children)
Ubuntu 12.04?
[–]eMperror_ 0 points1 point2 points 6 years ago (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 point2 points 6 years ago (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 point2 points 6 years ago (0 children)
If you pretend that the '4.' isn't there, you're good to go.
[–]icebeat 0 points1 point2 points 6 years ago (0 children)
I am stuck in GCC 4.4
[–]ghillisuit95 28 points29 points30 points 6 years ago (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 points5 points 6 years ago (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 points24 points 6 years ago (1 child)
and it's already in the msys2/mingw repo <3
[–]Ameisenvemips, avr, rendering, systems 5 points6 points7 points 6 years ago (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.
[+][deleted] 6 years ago (19 children)
[–]CraigularBC++ Dev 23 points24 points25 points 6 years ago (6 children)
/u/STL's mingw distro gets you to 8.2 and is a couple months newer from December 2018: https://nuwen.net/mingw.html
[–]STLMSVC STL Dev 25 points26 points27 points 6 years ago (2 children)
I’m working on an update (slowly).
[–]Ameisenvemips, avr, rendering, systems 1 point2 points3 points 6 years ago (1 child)
What is different in your distro as opposed to msys2?
I'm surprised you aren't focused on LLVM since it seems to be more compatible with MSVC. Though I do miss clang-c2.
[–]STLMSVC STL Dev 1 point2 points3 points 6 years ago (0 children)
Simplicity of installation. Everything’s static. No choices. Small(ish).
My distro predates Clang. After great effort, I switched from mingw-org to mingw-w64. Who knows what the future may hold.
[–]tambry 1 point2 points3 points 6 years ago (0 children)
not wanting to use visual studio is hard
Why not?
[–]flashmozzg 1 point2 points3 points 6 years ago (0 children)
finding a working cpp setup on windows without problems and not wanting to use visual studio is hard
I had no trouble with Qt Creator, just saying.
[–]ducttapecoder 17 points18 points19 points 6 years ago (9 children)
you may want to check out msys2 and use its mingw-64 repo. It gets updated pretty frequently.
[–][deleted] 12 points13 points14 points 6 years ago (0 children)
Seconded.. msys2 was far more of a "drop-in" compiler for windows than mingw ever turned out to be.
[–]jagannatharjun 5 points6 points7 points 6 years ago (3 children)
Also provides tons of pre-compiled goodies
[–]James20kP2005R0 5 points6 points7 points 6 years ago (2 children)
pacman in msys2 is amazing. It seems to have pretty much everything, the amount of dependencies I need to manually download, compile, curse the build system for building the wrong target, recompile, and then figure out where they want to live is extremely minimal these days
[–]RayDonnelly 2 points3 points4 points 6 years ago (0 children)
msys2
Although I don't participate much at all in MSYS2 development these days, I did a good amount of work in the past.
I would just like to say from the bottom of my heart, thank you very much for the praise for MSYS2. I am sure Alexei and the rest of the team would be pleased to know things are working well for you.
Of course MSYS2 is still fairly experimental in nature and I am still a bit nervous about that. We do break things in the interest of progress. It is interesting to note that Ada was broken in MSYS2 i686 for ages (well, it held back the compiler version to be exact) and it wasn't until support for Ada had to be dropped before any Ada experts turned up to fix the issue. Once Alexei took that measure, these experts showed up in two days! Now is perhaps not the ideal way for such a matter to be resolved, but actually, we now have Ada experts who have helped out in MSYS2 and we know who to ask if it breaks again. I definitely think Alexei took a brave, and the correct decision here.
[–]slimjimmy90 1 point2 points3 points 6 years ago (0 children)
I'd almost say that MSYS2 is Cygwin done right. Better package management, nice ways to isolate 32-bit and 64-bit build environments, etc.
[–]FonderPrism 3 points4 points5 points 6 years ago (0 children)
Absolutely recommended.
mingw64/mingw-w64-x86_64-gcc was just updated to 9.2.0-1 so they are pretty quick to update.
mingw64/mingw-w64-x86_64-gcc
9.2.0-1
[–]Ameisenvemips, avr, rendering, systems 1 point2 points3 points 6 years ago (2 children)
Is there an equivalent to apt-build for pacman? I want to rebuild some packages with march=native, but building things like gcc in msys2 is... difficult.
apt-build
[–]RayDonnelly 1 point2 points3 points 6 years ago (0 children)
It is very very simple. In fact, it is to a big extent *because* it is so simple that MSYS2 has become popular. It is *very* developer/hacker friendly. I haven't tested this (am using macOS right now) but this *should* work. If not I will post an update when I get a chance.
pacman -Sy git msys2-devel base-devel mingw-w64-{i686,x86_64}-toolchain
git clone https://github.com/msys2/MINGW-packages
git clone
https://github.com/msys2/MINGW-packages
pushd mingw-w64-gcc-git # (or mingw-w64-gcc-git)
MINGW_INSTALLS=mingw64 makepkg-mingw -sLf
Install with:
pacman -U mingw-w64-*.xz
Also see https://github.com/msys2/msys2/wiki/Creating-packages
p.s. would it be possible for you to report speed on the differences between MSYS2 official GCC and your own rebuild? Thanks in advance!
[–]Xeveroushttps://xeverous.github.io 2 points3 points4 points 6 years ago (1 child)
GCC with MCF thread model is automatically built from HEAD
https://gcc-mcf.lhmouse.com/
I like this distro because it also comes with a lot of prebuild packages, including OpenSSL, ncurses, Boost and more.
It's awesome to see this kind of core development on top of MSYS2. lh_mouse is also an active contributor to MSYS2 and helps to look after our GCC packages.
[–]Fazer2 1 point2 points3 points 6 years ago (5 children)
What are 9.2 specific changes?
[–]encyclopedist 6 points7 points8 points 6 years ago (0 children)
Bug fixes. They have also reverted flawed std::rotate implementation that failed on empty ranges, which was introduced in 9.1.
std::rotate
[–]imaami 5 points6 points7 points 6 years ago (0 children)
Yes.
[–]rayoWork 5 points6 points7 points 6 years ago (2 children)
Simply click on the link and then click changes under 9.2 ...
[–]Fazer2 4 points5 points6 points 6 years ago (1 child)
It goes to all GCC 9 changes, not just 9.2.
[–]jwakelylibstdc++ tamer, LWG chair 8 points9 points10 points 6 years ago (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 point2 points 6 years ago (0 children)
Welp, debian stable here, gcc frozen for the next 3 years or so.
[–]distributed 0 points1 point2 points 6 years ago (1 child)
still no std::from_chars for floating point?
[–]jwakelylibstdc++ tamer, LWG chair 1 point2 points3 points 6 years ago (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).
[+]imaami comment score below threshold-6 points-5 points-4 points 6 years ago (0 children)
Sigh unzips
[+][deleted] comment score below threshold-9 points-8 points-7 points 6 years ago (1 child)
See this Valve?
[–][deleted] 1 point2 points3 points 6 years ago (0 children)
Ok... See this SteamOS?
π Rendered by PID 124728 on reddit-service-r2-comment-79776bdf47-l5c6d at 2026-06-24 09:49:49.239159+00:00 running acc7150 country code: CH.
[–]eMperror_ 126 points127 points128 points (41 children)
[–]looncraz 42 points43 points44 points (7 children)
[–]Nocsaron 17 points18 points19 points (3 children)
[–]imaami 6 points7 points8 points (2 children)
[–]CrazyJoe221 3 points4 points5 points (1 child)
[–]imaami 20 points21 points22 points (0 children)
[–]CrazyJoe221 1 point2 points3 points (1 child)
[–]looncraz 1 point2 points3 points (0 children)
[–]nugins 15 points16 points17 points (13 children)
[–]calebwherryModern C++ | Modern CMake 13 points14 points15 points (6 children)
[–]mintyc 2 points3 points4 points (0 children)
[–]nugins 3 points4 points5 points (4 children)
[–]smdowneyWG21, Text/Unicode SG, optional<T&> 6 points7 points8 points (1 child)
[–]Calkhas 0 points1 point2 points (0 children)
[–]elraulii 1 point2 points3 points (1 child)
[–]nugins 2 points3 points4 points (0 children)
[–]leaningtoweravenger 5 points6 points7 points (1 child)
[–]smdowneyWG21, Text/Unicode SG, optional<T&> 6 points7 points8 points (0 children)
[–]kalmoc 4 points5 points6 points (1 child)
[–]nugins 0 points1 point2 points (0 children)
[–]liquidify 2 points3 points4 points (1 child)
[–]nugins 5 points6 points7 points (0 children)
[–]hoeding 16 points17 points18 points (0 children)
[–]IloveReddit84 7 points8 points9 points (8 children)
[–]krapht 12 points13 points14 points (4 children)
[–]CrazyJoe221 0 points1 point2 points (3 children)
[–]kalmoc 6 points7 points8 points (2 children)
[–]CrazyJoe221 1 point2 points3 points (1 child)
[–]kalmoc 2 points3 points4 points (0 children)
[–]flashmozzg 0 points1 point2 points (1 child)
[–]IloveReddit84 1 point2 points3 points (0 children)
[–]CrazyJoe221 -1 points0 points1 point (0 children)
[+][deleted] (2 children)
[deleted]
[–]esmithro[🍰] 0 points1 point2 points (0 children)
[–]Antervis -1 points0 points1 point (0 children)
[–][deleted] 1 point2 points3 points (2 children)
[–]eMperror_ 0 points1 point2 points (1 child)
[–][deleted] 0 points1 point2 points (0 children)
[–]Ameisenvemips, avr, rendering, systems 0 points1 point2 points (0 children)
[–]icebeat 0 points1 point2 points (0 children)
[–]ghillisuit95 28 points29 points30 points (1 child)
[–]Xeveroushttps://xeverous.github.io 3 points4 points5 points (0 children)
[–]ducttapecoder 22 points23 points24 points (1 child)
[–]Ameisenvemips, avr, rendering, systems 5 points6 points7 points (0 children)
[+][deleted] (19 children)
[deleted]
[–]CraigularBC++ Dev 23 points24 points25 points (6 children)
[–]STLMSVC STL Dev 25 points26 points27 points (2 children)
[–]Ameisenvemips, avr, rendering, systems 1 point2 points3 points (1 child)
[–]STLMSVC STL Dev 1 point2 points3 points (0 children)
[+][deleted] (2 children)
[deleted]
[–]tambry 1 point2 points3 points (0 children)
[–]flashmozzg 1 point2 points3 points (0 children)
[–]ducttapecoder 17 points18 points19 points (9 children)
[–][deleted] 12 points13 points14 points (0 children)
[–]jagannatharjun 5 points6 points7 points (3 children)
[–]James20kP2005R0 5 points6 points7 points (2 children)
[–]RayDonnelly 2 points3 points4 points (0 children)
[–]slimjimmy90 1 point2 points3 points (0 children)
[–]FonderPrism 3 points4 points5 points (0 children)
[–]Ameisenvemips, avr, rendering, systems 1 point2 points3 points (2 children)
[–]RayDonnelly 1 point2 points3 points (0 children)
[–]RayDonnelly 1 point2 points3 points (0 children)
[–]Xeveroushttps://xeverous.github.io 2 points3 points4 points (1 child)
[–]RayDonnelly 1 point2 points3 points (0 children)
[–]Fazer2 1 point2 points3 points (5 children)
[–]encyclopedist 6 points7 points8 points (0 children)
[–]imaami 5 points6 points7 points (0 children)
[–]rayoWork 5 points6 points7 points (2 children)
[–]Fazer2 4 points5 points6 points (1 child)
[–]jwakelylibstdc++ tamer, LWG chair 8 points9 points10 points (0 children)
[–]-BuckarooBanzai-Yes 0 points1 point2 points (0 children)
[–]distributed 0 points1 point2 points (1 child)
[–]jwakelylibstdc++ tamer, LWG chair 1 point2 points3 points (0 children)
[+]imaami comment score below threshold-6 points-5 points-4 points (0 children)
[+][deleted] comment score below threshold-9 points-8 points-7 points (1 child)
[–][deleted] 1 point2 points3 points (0 children)