Linked by Thom Holwerda on Sat 29th Sep 2007 21:26 UTC, submitted by Chris Lattner
General Development The LLVM Project recently released a new version of their compiler, optimizer and code generators. LLVM includes a drop-in GCC-compatible C/C++ and ObjC compiler, mature optimization technology (including cross file/whole program optimization), and a highly optimizing code generator. For people who enjoy hacking on compilers and runtimes, LLVM provides libraries for implementing custom optimizers and code generators including JIT compiler support. This release is the first to provide beta GCC 4.2 compatibility as well as the new "clang" C/ObjC front-end, which provides capabilities to build source-to-source translators and many other tools.
Thread beginning with comment 275312
To read all comments associated with this story, please click here.
GCC
by saxiyn on Sun 30th Sep 2007 03:57 UTC
saxiyn
Member since:
2005-07-08

In my opinion, GCC has a near monopoly on the compiler market, and that's not healthy.

Case in point: Linux kernel makes liberal uses of GCC extensions, so other compilers are out of luck. Therefore Intel C Compiler implements all kinds of GCC extensions, and define __GNUC__! Exactly like Internet Explorer advertising itself as "Mozilla" in user-agent string. Same goes for glibc. glibc headers are broken if __GNUC__ is not defined. Just look at Tiny C Compiler development list for workaround they had to put up with to use glibc headers. (TCC refuses to define __GNUC__, but what a pain it causes.)

Other free software projects too often depend on non-standard features of GCC, effectively disadvantaging alternative compilers. But kernel and libc are the most serious offender.

I predict rough and difficult roads ahead of clang, not only for difficulty of implementing C language standard, but also for fighting free softwares that won't compile with anything other than GCC.

Reply Score: 14

RE: GCC
by smitty on Sun 30th Sep 2007 04:11 in reply to "GCC"
smitty Member since:
2005-10-13

The great thing about open source software is that anyone can patch the software so that other compilers can compile it. If other compilers start gaining users I'm sure that will happen, but for now I think it is understandable given almost everyone uses GCC. I know that the KDE project is currently fixing it's software to work with Sun Studio since they're officially supporting Solaris with KDE4.

Edited 2007-09-30 04:17

Reply Parent Score: 6

RE[2]: GCC
by KugelKurt on Sun 30th Sep 2007 20:55 in reply to "RE: GCC"
KugelKurt Member since:
2005-07-06

If the Linux kernel developers had any interest in supporting any compilers other than GCC, GCC-specific code hadn't been accepted into the code repository in the first place.

Reply Parent Score: 1

RE: GCC
by dagw on Sun 30th Sep 2007 13:28 in reply to "GCC"
dagw Member since:
2005-07-06

It can also lead gcc users into bad habbits. I taught myself C using gcc, whenever I had a problem I'd search usenet and the web and often find solutions often posted by people who also used gcc. As such things where fine and I learned many things and started getting a good grasp of C (or so I thought).

Then, later, I ended up writing C code at a place that didn't use gcc, but a different and much stricter compiler. All of sudden many of the things that had been worked fine for me all along gave a bunch of strange compiler errors. So I ended up having to re-learn much about C which I thought I already knew.

Reply Parent Score: 3

RE[2]: GCC
by FooBarWidget on Mon 1st Oct 2007 12:18 in reply to "RE: GCC"
FooBarWidget Member since:
2005-11-11

So use '-Wall -Werror -c99 -pedantic'. You *can* make GCC stricter.

Reply Parent Score: 3