We have Red Hat 6 and CentOS 7 OS as our build machines for C & C++ codebases.
We currently use the default gcc compiler that comes with the OS. gcc versions are 4.8.5 and 4.9.x, respectively. You may know that these compilers are at the mentioned gcc versions and have some 'managed updates' put on them, as managed by Red Hat. Clearly, they are years old as compared to the latest stable version of gcc.
We are considering upgrading to latest stable gcc version - right now, this is 9.2.0.
I would like to know how to go about deciding about upgrade and the reasons to stay with default compiler or to go for the upgrade.
Arguments for staying with default compiler:
- the default compiler is tried & tested for
- this OS this is pretty much what we have ever used in life
- probable instability concerns with compiler upgrade
Arguments for compiler upgrade to latest stable version:
- upgrading compilers many times at other places has been smooth as silk. Honestly, do you remember the last time you reported a compiler defect?
- go for the latest & the greatest in optimizations - even existing code may get better
- latter compilers use newer instructions set to leverage modern processors
- enable modern implementations = simpler code with greater expressivity & clarity of intent, greater portability, more robust with newer constructs, easy modern facilities
- backward compatability ensures existing code compiles well with hardly any change - both compiler & language standards ensure this!
Really, is the default compiler that ships with the OS tailor-made and special enough to stay with it 5 versions and 2 C++ standards later? Or, are we stuck in our thinking?
To upgrade or not to upgrade is the question!