Hi there,
why is in Leap 15.2 GCC 7 and GCC 9 installed both at the same time, while GCC 7 is default?
Why isn´t GCC 9 the default?
Would it be safe to switch to GCC 9?
In my case, the most work I do with GCC is to build the kernel…the more recent GCC is, the better AMD Ryzen support. I hope.
Checking here, only “gcc7” is installed. I think that came via the base-development pattern. If you also have “gcc9”, then you probably made some choice that caused it to be installed.
I think you can use “update-alternatives” to select which is the default choice.
If you have multiple gcc installed, you can switch between them easily if you set up Alternatives,
Unless something has changed, installing gcc versions only install the binaries on your machine but don’t provide a way to easily use a non-default or switch between them.
I wrote a wiki how to do this
Different gcc may be required by various source.
Since gcc is only used to compile once, once it’s done its job any version can usually be left enabled or not at all other times. Nowadays I’m not aware of anything that is explicitly re-compiled regularly and often.