tags:

views:

40

answers:

1

The project I'm working with is compiled with GCC 3.4.2. I'm considering switching to a newer compiler. However, the project is at a stage where we're not making any big changes if the risks aren't well known.

What sort of problems can I expect when switching compilers?

What benefits does GCC 4.x give over GCC 3.4.2?

What benefits does ICC give over it?

+2  A: 

The benefit is mostly performance and code size. Later and different compilers often have better or clearer errors and warnings.

Fortunately, while you can expect trouble getting the project to compile, so there will be a bit of work to get it to run, once it does it is extremely likely to behave identically, other than performance. If your code does a lot of floating point, you need to read and understand all the floating point options, because that's the most likely point where behaviour may change.

Andrew McGregor
What sort of trouble? Do you mean things that are now forbidden but weren't previously?
Nathan Fellman
Mostly exactly that, yes. Basically, warnings getting promoted to errors so you have to fix them. The cleaner the project was, the less of this you get. If you had good unit tests (unlikely for a C project) then once it compiles they should show that it all works.
Andrew McGregor