This is something that had been bugging me for many, many years…
We can install multiple versions of gcc from the OSS and from software.opensuse.org side by side so there is no conflict, but then the question was how to configure a script to reference the correct gcc?
I’d even submitted a feature request to the bugzilla asking for someone to create an update-alternatives for gcc.
This is an extremely acute problem in Tumbleweed because although bleeding edge compilers are installed by default, most software assume the current stable or older compilers are what’s available.
Recently I came across update-alternatives for gcc used in a software project and when I saw it, it was one of those head-slapping moments… The compiled gcc is very simple (only a single binary with no massive spiderweb of dependent links like Java) and so is easily implemented.
So, I wrote up a Wiki page how to do this very simple thing that is asked all the time in these Forums
https://en.opensuse.org/User:Tsu2/gcc_update-alternatives
And yes, I <still> say that every gcc that’s distributed through an openSUSE repo should automatically install its update-alternatives, especially now that we know it’s so simple to do.
Enjoy,
TSU