Best C/C++ compiler
Best C/C++ compiler
Ive desided not to make a vote as i probably dont know half of those in existence.
A few rules though, OS independency, meaning that the compiler have to be avalible for for at least windows and linux. Also it has got to be freeware, opensource, whatever...
Free it has got to be!
A short discribition including pros and cons and stuff would allso be nice.
Regards
A few rules though, OS independency, meaning that the compiler have to be avalible for for at least windows and linux. Also it has got to be freeware, opensource, whatever...
Free it has got to be!
A short discribition including pros and cons and stuff would allso be nice.
Regards
Few hints about possible winners:
GCC for obvious reasons
ICC (Intel C++ Compiler) - Fast, windows + linux, good code generation, free to use for non-commercial (and possibly also commercial) but not open source
Metrowerks Codewarrior - No clue, just well-known for being pretty good
Comeau C++ - Not all that known but the first C++ compiler to support export, so it must have its merits.
My vote is for GCC because of ubiquity, ease of use, clear error messages (apart from templates - but that's being worked on in the language and the others are even worse) and speed. It's also very good at guessing what I'm trying to do instead of what I type so at times I type some 100 lines of code and it optimizes my handy syntactic sugar to 4 lines of assembly.
GCC for obvious reasons
ICC (Intel C++ Compiler) - Fast, windows + linux, good code generation, free to use for non-commercial (and possibly also commercial) but not open source
Metrowerks Codewarrior - No clue, just well-known for being pretty good
Comeau C++ - Not all that known but the first C++ compiler to support export, so it must have its merits.
My vote is for GCC because of ubiquity, ease of use, clear error messages (apart from templates - but that's being worked on in the language and the others are even worse) and speed. It's also very good at guessing what I'm trying to do instead of what I type so at times I type some 100 lines of code and it optimizes my handy syntactic sugar to 4 lines of assembly.
- Brynet-Inc
- Member
- Posts: 2426
- Joined: Tue Oct 17, 2006 9:29 pm
- Libera.chat IRC: brynet
- Location: Canada
- Contact:
I can name a few that I know... but haven't used for OSDev..
The following should be are Open Source.. or at least have source available..
http://fabrice.bellard.free.fr/tcc/ - Tiny C Compiler - Open Source/Portable.
http://www.cs.princeton.edu/software/lcc/ - LCC - A Retargetable Compiler for ANSI C.
http://tack.sourceforge.net/ - The Amsterdam Compiler Kit - It's based off of the BSD licenced Minix C compiler.
http://www.tendra.org/ - BSD licenced C/C++ compiler... neat project..
http://nwcc.sourceforge.net/ - Nils Weller's C compiler - Another BSD licenced C compiler...
http://www.cpm.z80.de/small_c.html - Small C - It's a common C compiler... It's old though..
http://retro.tunes.org/simplec/ - Simple C - Port of Small C for Linux..
I'm sure you could find a few other smaller projects, The big one your already know about .. http://gcc.gnu.org/
The many proprietary/freeware compilers shall remain nameless
The following should be are Open Source.. or at least have source available..
http://fabrice.bellard.free.fr/tcc/ - Tiny C Compiler - Open Source/Portable.
http://www.cs.princeton.edu/software/lcc/ - LCC - A Retargetable Compiler for ANSI C.
http://tack.sourceforge.net/ - The Amsterdam Compiler Kit - It's based off of the BSD licenced Minix C compiler.
http://www.tendra.org/ - BSD licenced C/C++ compiler... neat project..
http://nwcc.sourceforge.net/ - Nils Weller's C compiler - Another BSD licenced C compiler...
http://www.cpm.z80.de/small_c.html - Small C - It's a common C compiler... It's old though..
http://retro.tunes.org/simplec/ - Simple C - Port of Small C for Linux..
I'm sure you could find a few other smaller projects, The big one your already know about .. http://gcc.gnu.org/
The many proprietary/freeware compilers shall remain nameless
- Combuster
- Member
- Posts: 9301
- Joined: Wed Oct 18, 2006 3:45 am
- Libera.chat IRC: [com]buster
- Location: On the balcony, where I can actually keep 1½m distance
- Contact:
I think it depends on where you ask - the majority here uses GCC for it suiting the purposes of OS development. If you'd ask a regular windows programmer, you'd probably hear Visual C as being the best compiler. (not that it qualifies for the purposes here.)
If you ask at the right place ICC may very well be the most likely answer.
Of the compilers I have tried that meet the criteria, nwcc didn't compile under cygwin, leaving GCC as the only alternative. (I did try installing lcc once, but since that box had less than 30 mb free that obviously didn't work out)
If you ask at the right place ICC may very well be the most likely answer.
Of the compilers I have tried that meet the criteria, nwcc didn't compile under cygwin, leaving GCC as the only alternative. (I did try installing lcc once, but since that box had less than 30 mb free that obviously didn't work out)
C++ programmers that use the language rarely answer Visual C++ as their preferred compiler as it contains a number of flaws and errors that make using C++ with it harder than is necessary. I haven't used the bottom of the options in C++ and I've been hit by a compiler bug in VS2005 already, so it aren't even just the unlikeliest cases.Combuster wrote:I think it depends on where you ask - the majority here uses GCC for it suiting the purposes of OS development. If you'd ask a regular windows programmer, you'd probably hear Visual C as being the best compiler. (not that it qualifies for the purposes here.)
- Brynet-Inc
- Member
- Posts: 2426
- Joined: Tue Oct 17, 2006 9:29 pm
- Libera.chat IRC: brynet
- Location: Canada
- Contact:
I found another compiler, I'm not sure about licencing.. but the source is available.. supports many processor architectures.
http://www.compilers.de/vbcc.html - vbcc - portable ISO C compiler..
I'm done searching, but I though it was worth trying to index a few of them
http://www.compilers.de/vbcc.html - vbcc - portable ISO C compiler..
I'm done searching, but I though it was worth trying to index a few of them
Last time I looked, ICC generated much more efficient code than GCC (~20% better). However, that has been quite some time since, and GCC 3.x. AFAIK, one of the goals of GCC 4.x was to rectify this, I don't know how successful they were.zeii wrote:Does the Intel compiler have any serious advantages over GCC?
Oh, and I'd like to stress that the EDG / Cameau compiler is the only fully compliant C++ compiler available. Funny thing: The EDG was adamant in their resistance against including "export" in the C++ standard, yet still they're the only ones that implemented it in their compiler...
Every good solution is obvious once you've found it.
- kataklinger
- Member
- Posts: 381
- Joined: Fri Nov 04, 2005 12:00 am
- Location: Serbia
1. Intel C++
2. MSFT VC++ (7.0+)
3. all others
2. MSFT VC++ (7.0+)
3. all others
I read somewhere (and saw tests) that in fact ICC generated code is executed faster on AMD's processors then code generated by other compliers in most cases.ICC generates better code, but some very fine-tuning of optimizations cause it to (automatically) fail on non-Intel processors. 90% of code will probably never reach that point, though.
- Brynet-Inc
- Member
- Posts: 2426
- Joined: Tue Oct 17, 2006 9:29 pm
- Libera.chat IRC: brynet
- Location: Canada
- Contact:
I remember reading that Intel's C/C++ compiler generates code that deliberately "favours" Intel Processors..niteice wrote:I'm not surprised. However, what I was referring to was a small processor check at program startup that automatically terminates if the machine doesn't have at least a specific model of Intel processor (generally a feature set such as SSE3).
http://www.swallowtail.org/naughty-intel.html
According to that article it was eventually "fixed" in newer versions... but it's still interesting...
I'll stick with GCC .. hopefully the BSD licenced C compiler that was imported into OpenBSD improves as well