|
Clang's compile errors are great |
Mark Oates
Member #1,146
March 2001
|
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"} -- |
Edgar Reynaldo
Major Reynaldo
May 2007
|
Sorry but last time I tried to use Clang on Windoze it was a horrible broken mess. My Website! | EAGLE GUI Library Demos | My Deviant Art Gallery | Spiraloid Preview | A4 FontMaker | Skyline! (Missile Defense) Eagle and Allegro 5 binaries | Older Allegro 4 and 5 binaries | Allegro 5 compile guide |
Chris Katko
Member #1,881
January 2002
|
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. Edgar Reynaldo said: 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: |
Edgar Reynaldo
Major Reynaldo
May 2007
|
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 My Website! | EAGLE GUI Library Demos | My Deviant Art Gallery | Spiraloid Preview | A4 FontMaker | Skyline! (Missile Defense) Eagle and Allegro 5 binaries | Older Allegro 4 and 5 binaries | Allegro 5 compile guide |
dthompson
Member #5,749
April 2005
|
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) ______________________________________________________ |
raynebc
Member #11,908
May 2010
|
I installed Clang years ago when I found they were releasing Windows binaries: 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
|
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: |
Neil Roy
Member #2,229
April 2002
|
Never had a problem tracking down my bugs with GCC and Code::Blocks yet. Plus GCC is more widely supported with good extensions and up to date. --- |
bamccaig
Member #7,536
July 2006
|
Error messages don't get too crazy in C. It's more for C++ and especially templates. -- acc.js | al4anim - Allegro 4 Animation library | Allegro 5 VS/NuGet Guide | Allegro.cc Mockup | Allegro.cc <code> Tag | Allegro 4 Timer Example (w/ Semaphores) | Allegro 5 "Winpkg" (MSVC readme) | Bambot | Blog | C++ STL Container Flowchart | Castopulence Software | Check Return Values | Derail? | Is This A Discussion? Flow Chart | Filesystem Hierarchy Standard | Clean Code Talks - Global State and Singletons | How To Use Header Files | GNU/Linux (Debian, Fedora, Gentoo) | rot (rot13, rot47, rotN) | Streaming |
Chris Katko
Member #1,881
January 2002
|
Yeah. C is a pretty simple language--by design. I can't imagine errors "should" be that complex compared to template within template instantiation errors. -----sig: |
Edgar Reynaldo
Major Reynaldo
May 2007
|
Okay, I figured I'd give latest Clang LLVM a go. It's on version 6 point 0 and last version I tried was 3 point 9, so it's been a while. Installing out the box, a huge red flag came up. Why does it need 1.000 GB of space? Dang dude, what gives? I'll install somewhere else, but really, sheesh. Is this VS or what? {"name":"611480","src":"\/\/djungxnpq2nug.cloudfront.net\/image\/cache\/e\/5\/e56b7ecae8c1f1aa8b90bfb419b3e7db.png","w":581,"h":477,"tn":"\/\/djungxnpq2nug.cloudfront.net\/image\/cache\/e\/5\/e56b7ecae8c1f1aa8b90bfb419b3e7db"} EDIT EDIT 2 Okay, it can compile an empty main. However it chokes on some use of std::vector<std::string>, or at least chokes out a warning and compiles anyway. However, I can't give you much credit here Oates, this one is a doozy : e:\LLVM32\bin>clang ..\CODE\SplitTest.cpp SplitTest-e670c2.o : warning LNK4217: locally defined symbol ___std_terminate imported in function "int `public: __thiscall std::vector<class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >,class std::allocator<class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > > >::vector<class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >,class std::allocator<class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > > >(void)'::`1'::dtor$2" (?dtor$2@?0???0?$vector@V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@V?$allocator@V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@2@@std@@QAE@XZ@4HA) SplitTest-e670c2.o : warning LNK4217: locally defined symbol __CxxThrowException@8 imported in function "int `public: void __thiscall std::vector<class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >,class std::allocator<class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > > >::emplace_back<class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const &>(class vector<class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >,class std::allocator<class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > > >::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const &)'::`1'::catch$6" (?catch$6@?0???$emplace_back@ABV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@?$vector@V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@V?$allocator@V?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@2@@std@@QAEXABV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@1@@Z@4HA) e:\LLVM32\bin>
My Website! | EAGLE GUI Library Demos | My Deviant Art Gallery | Spiraloid Preview | A4 FontMaker | Skyline! (Missile Defense) Eagle and Allegro 5 binaries | Older Allegro 4 and 5 binaries | Allegro 5 compile guide |
|