Best c++ compiler

Nov 22, 2013 at 10:49am
Hello everybody!
Which c++ compiler is the best?
Nov 22, 2013 at 11:41am
"Best" is a relative term. What are you looking for? High generated code quality? Support for obscure instruction sets? Options to not generate code using remotely obscure instruction sets? Cross-compilation ability? Quick compile times?

Even then, it's not a clear-cut "this compiler is better" answer, as that depends on situation to situation. Compilers are very complex pieces of code (at least the good ones are).

Generally, you can't go wrong with Microsoft's C++ compiler (although that one I have some gripes with due to it supporting anti-standard code), clang, or g++. Those are kind of like the big three.

-Albatross
Last edited on Nov 22, 2013 at 11:46am
Nov 22, 2013 at 12:01pm
1. Cross-compilation for some my tasks.
2. Must work on bare metal to make some utilities and I would like to make OS.
Last edited on Nov 22, 2013 at 12:01pm
Nov 22, 2013 at 3:29pm
Code::Blocks is a good one. Not sure if it does what you asked.
Nov 22, 2013 at 3:33pm
If you want to make an OS...
1) Why?
2) Do you realize the enormity of the task?
3) C++ is probably not the language to do it.
Nov 22, 2013 at 3:40pm
closed account (Dy7SLyTq)
Code::Blocks
code blocks is an ide no a compiler

C++ is probably not the language to do it.

as long as you have assembly you can use c++ too. but you cant do it just in c++
Nov 22, 2013 at 4:01pm
You could do it in pure C++, it just would require some hackery and possibly designing your own compiler toolset.
Nov 22, 2013 at 6:31pm
closed account (Dy7SLyTq)
alright let me rephrase. you cant do it with pure c++ using well established compilers such as gcc or vc++. there might be other reasons, but the only one i can think of off the top of my head is c++ cant handle the interrupts that come so you need assembly for that
Nov 25, 2013 at 9:20am
Thank you Albatross and other people!
Also, I would like to find out, which compiler to use with Oracle 11
1. in Windows 7
2. in SUSE Linux Enterprise Server 11 (x86_64)
Nov 25, 2013 at 9:51am
if you want to make your own OS for x86/x64 use intel compiler or amd compiler.

@DTSCode - c++ is containing C - of course it can handle interrupts. In OS programming you only need to use assembler to set start address for the boot-loader.

C++ is not good for low-level OS programming because in bare metal CPU there is no new or delete keywords - you need to implement them yourself to use dynamic allocation, etc.. Just use C for kernel and drivers then use cpp for higher levels.
Last edited on Nov 25, 2013 at 9:58am
Nov 25, 2013 at 3:41pm
closed account (Dy7SLyTq)
c++ is containing C
not completely true
of course it can handle interrupts.
no it cant. we are thinking of two different interrupts. im not talking about ctrl+c. http://en.wikibooks.org/wiki/X86_Assembly/X86_Interrupts

C++ is not good for low-level OS programming because in bare metal CPU there is no new or delete keywords - you need to implement them yourself to use dynamic allocation
you can use new and delete with c++ and still have it work fine with assembly code. you dont need to implement anything

http://wiki.osdev.org/Interrupt_Service_Routines
Nov 25, 2013 at 10:31pm
you can use new and delete with c++ and still have it work fine with assembly code. you dont need to implement anything
i based my answer on http://www.brokenthorn.com/Resources/OSDevMSVC.html (Developing a C++ Runtime Envirement for MSVC++).

no it cant.
this was my bad. I mixed typical mcu architecture interrupt handling with x86 which is using instruction to access interrupts.
Nov 25, 2013 at 10:39pm
closed account (Dy7SLyTq)
http://www.drpaulcarter.com/pcasm/pcasm-book-pdf.zip go to the c++ section in the back
Nov 26, 2013 at 4:03am
Thanks a lot.
Is it possible to use Open Watcom C++ to make OS?
Topic archived. No new replies allowed.