# Confused about clang



## Majorix (Oct 12, 2012)

I just upgraded a VM to -CURRENT, and I was wondering about a few things related to it.

1. What is clang? An alternative to gcc? In which way is it superior since FreeBSD switches to it?

2. Do I have to do anything (edit make.conf, etc) for clang to take effect, or will it take effect automatically?

3. I am studying CS and most of the time I have to compile/run C and C++ codes. Is it OK if I use gcc on FreeBSD or should I use my Debian Linux installation for that?

Thanks!


----------



## kpa (Oct 12, 2012)

Its main advantage is BSD license compatible licensing, the base system gcc is still stuck at version 4.2.1 because the newer versions of gcc use a viral GPL license.


----------



## Lorem-Ipsum (Oct 12, 2012)

In my opinion clang has a much more useful output and seems to be faster than GCC. From what I've read it's quite compatible with GCC but there are some things GCC will accept that clang will not.

You shouldn't have to touch make.conf if you want to use clang, unless the makefile specifies gcc.

It's your computer, you can choose what you want to do with it.


----------



## Majorix (Oct 12, 2012)

Thanks guys, it is clearer in my mind now.


----------



## UNIXgod (Oct 12, 2012)

gcc was beginning to suffer from code rot. We could have simply kept on patching it but clang makes more sense at this point. Our gcc is 4.2.1 where the project is up to 4.8 or 4.9 at this point with modern processor support. 

Look up *tivoisation* which is one of the main reasons RMS and the FSF made a switch to the next version of the GPL.

As much as it would be interesting to romanticize the ideal of removing all gpl software from base it was never really an issue until GPLv3 became intact.

Also it is true that clang is more verbose if your a C or C++ programmer. This may make competition work towards innovation so I wouldn't be surprised if gcc catches up to `make` actually telling you what include files your missing and so on.

I will miss the cute easter egg hacks like the "effective c++" wall (i.e. -Weffc++)


----------

