Favourite Compiler?

Pages: 12
closed account (N36fSL3A)
Visual Studio has a free version you know.

I think I and EssGeEich just find it weird that you like Clang solely because it 'corrects you' when you make typos. I think you should know if you make a typo when it says something like "No member 'cbout' in namespace 'std'."
@CaptainBlastXD: Yes, yes, it was purely a personal opinion.
closed account (G30GNwbp)
the compiler gives you errors, warnings, and compiles code. If I am happy with the warning and errors I see with g++ is there any reason for me to change to clang++?
In other words is the program produced by clang++ better than g++, and if so how is this improvement measured?
@rtd
Cubbi wrote:
clang is the solid favorite since about 2010, when it got ahead of g++ in the new standard adoption (narrowly in core language features, and by a huge margin in the standard library, which g++ is still struggling with).


sounds like it is adopting and adding c++11 features at a faster rate than g++

which makes me curious about it
closed account (Dy7SLyTq)
so whats the difference between clang and gcc then?
My favourite compiler is VC++ 2013. I see that clang++ has a lot of heat in this thread, that eagers me to try it out.

Edit: I installed LLVM (which has clang++ of course), and when I compile a code then run it, the program crashes in the end. No one mentions that?
Last edited on
All compilers can do that, especially if you write bad code.
No, I have tested the same code with g++ and VC2013 and it doesn't crash.
Here is the code (in case you still think that my code is bad):

1
2
3
4
5
6
7
8
9
10
11
12
13
#include <iostream>
#include <string>

using namespace std;

int main()
{
    string name;
    cout << "Enter your name: ";
    cin >> name;
    cout << "Hello " << name << "!" << endl;
    return 0;
}
Stormboy wrote:
...in case you still think that my code is bad...

no, but I do wonder about your ability if you seriously think that it is a systemic error with LLVM rather than a bad installation/build on your system.
@Stormboy: here's how it runs with clang++ online: http://coliru.stacked-crooked.com/a/729deffa3b1e5b5c
closed account (G30GNwbp)
cubbi stated and was reposted by Paoletti wrote:

clang is the solid favorite since about 2010, when it got ahead of g++ in the new standard adoption (narrowly in core language features, and by a huge margin in the standard library, which g++ is still struggling with).


In 2010 I was not using the new standard--I did not think clang++ was still ahead at this point in time. In what ways is g++ still struggling?

The reason I ask is the clang that is the repositories for debian, right now, is definitely behind g++; so I would have to build it myself (and that is always at least a day of reading which I don't want to bother with for features I will never use). I have been using g++ for a few years I am quite comfortable with their errors and warnings.

The only thing I know that is still not up-to-snuff that I want to use is <regex>.

Please don't post a link saying something works if you have not used it--because this information doesn't help. For example g++ says that <regex> works as of 4.8--but if you tried to use it you know this is not the case.
Last edited on
closed account (Dy7SLyTq)
actually it doesnt work with 4.8. it works with 4.8.2. there is a patch for it i believe.
closed account (G30GNwbp)
This post was removed. My comment should not have been made public so I removed it.
Last edited on

no, but I do wonder about your ability if you seriously think that it is a systemic error with LLVM rather than a bad installation/build on your system.


I did not build it, I downloaded and installed from the pre-built binary for Windows from the LLVM site.
Last edited on
rtd2645 wrote:
In what ways is g++ still struggling?

g++'s core language features caught up (as in, the both miss about the same number of features and claim feature completeness), it's struggling in the library department.

The big one for most people was of course the regex library, but that was implemented 3 months ago, 7 years late (It predates C++11: it was a TR1 component, like <array>). I haven't had a chance to really test it, but I did see some regex_traits parts missing when reviewing the trunk.

The big one for me is that it's still missing the entire <codecvt> which houses all of C++11 Unicode library functionality, along with string and buffer conversions (MS and Clang both had that in 2010 in their respective libraries).
It's also missing quite a few smaller C++11 items: streams aren't movable, threads miss everything having to do with thread exit, atomics miss shared_ptr specializations, some type traits aren't there, some allocator support isn't there, etc. Even something as trivial as std::align is not in.

All of that is in clang's library: it's complete for C++11 and C++14 as currently drafted (except where it is forced to rely on the incomplete C library, as is the case with <cuchar>)
Last edited on
closed account (G30GNwbp)
After visiting this site I was able to install clang++ for Debian without building it myself
http://llvm.org/apt/

This is the version installed:
Debian clang version 3.5-1~exp1 (trunk) (based on LLVM 3.5)

Tomorrow I will perform my test using <regex> --if it works better than g++ -- I plan to sing the praises of clang that others have been singing.

Tomorrow I will perform my test using <regex>

Don't forget to install the library, http://libcxx.llvm.org/
Topic archived. No new replies allowed.
Pages: 12