Allegro.cc - Online Community
Post Reply

Allegro.cc Forums » Game Design & Concepts » Clang's compile errors are great

rss feed Print
Clang's compile errors are great
Mark Oates
Member #1,146
March 2001
avatar

If you guys are using a different compiler, ya'll are missing out:

{"name":"611460","src":"\/\/djungxnpq2nug.cloudfront.net\/image\/cache\/b\/8\/b81c3c044a25185ed716f167c17ff525.png","w":1176,"h":148,"tn":"\/\/djungxnpq2nug.cloudfront.net\/image\/cache\/b\/8\/b81c3c044a25185ed716f167c17ff525"}611460

Edgar Reynaldo
Member #8,592
May 2007
avatar

Chris Katko
Member #1,881
January 2002
avatar

Clang is !@$!@$!@$(!&@$)(!@$()!&@$)(&!@$ amazing. The first time I finally tried it, it blew me away.

(Though I miss all the cool GCC extensions to C and C++.)

It's worlds better than GCC. And I salute GCC for their effort, but they have multiple distinct passes and optimize (and toss away data) inbetween them which means when it tries to generate error messages you get "tits all" compared to Clang.

I've been using the LLVM-backend with D (LDC) and I like that as well. Though I recently switched to DMD (the spec compiler) because it compiles faster, and has easier-to-access profiling data and more detailed usage instructions. But that's not as applicable.

Sorry but last time I tried to use Clang on Windoze it was a horrible broken mess.

Use Linux. :) Or get "Linux for Windows." But yeah, give Clang a try. It's getting better every year. (Really, every 6 months! They're rapidly passing GCC.) It's really a brilliant idea. You decouple the front-end from the back-end, keep everything modular, and you can WAY more easily add a new language to a front end, while keeping all the back-end the same. Or vice versa, and support a new OS or CPU.

Some guys literally combined D (using LDC) and... C++ (using Clang)... and combined them together to let you directly import C++ code into D code without tons of wrappers/bindings/etc. I don't think you could do that easily with any/most other compilers--especially for a project with one or two guys writing/maintaining it.

https://github.com/Syniurge/Calypso

I don't know if these numbers are meaningful, or meaningless, but they took LDC, and they're only 1310 commits ahead, added C++. Those commits could be huge, I don't know. But it seems like a small number of "decisions" needed to convert a compiler to add an entirely separate second compiler into the mix.

-----sig:
“Programs should be written for people to read, and only incidentally for machines to execute.” - Structure and Interpretation of Computer Programs

Edgar Reynaldo
Member #8,592
May 2007
avatar

Sorry, clang is fail. CMake doesn't support it. Clang doesn't support windows. They claim to, but it doesn't work. At all. It tries to use MSVC.

EDIT
If there were binaries that were configured correctly for Windows I would try it again, but I don't know how to get clang to work right.

dthompson
Member #5,749
April 2005
avatar

Quote:

CMake doesn't support Clang

Correct me if I'm wrong, but aren't A5 builds (which heavily involve CMake) tested on Clang in addition to gcc?

I'm considering making the move from gcc, but would probably want to add an MSVC deviation to any Windows builds I'd do of A5 projects anyway (regardless of how hard Microsoft might try to crowbar Unix tools into Windows these days)

______________________________________________________
Website
Where my website used to be

raynebc
Member #11,908
May 2010

I installed Clang years ago when I found they were releasing Windows binaries:
http://releases.llvm.org/download.html#6.0.0

I don't remember it being complicated, I just installed it to C:\LLVM and can invoke it separately from MinGW's GCC. I run it every once in a while to see if it picks up any warnings that GCC doesn't give.

Chris Katko
Member #1,881
January 2002
avatar

Yeah, I don't... I don't know the details for Windows. But I've had zero problems with Clang on Linux.

Like, incredibly easy to both install binaries, OR, compile straight from a git clone. All you need is some GB of space and some time, and it just runs, and finishes.

I've installed multiple forks of both LLVM and Clang (and LLVM-based LDC) with no problem.

-----sig:
“Programs should be written for people to read, and only incidentally for machines to execute.” - Structure and Interpretation of Computer Programs

Post Reply
Go to: