How to convince any C developer to dump gcc and use clang
1–10 of 97 posts
Re: How to convince any C developer to dump gcc and use clang
#2My point is Clang is good but friendly error messages is not the only reason I would change to Clang.
Re: How to convince any C developer to dump gcc and use clang
#3Re: How to convince any C developer to dump gcc and use clang
#4Re: How to convince any C developer to dump gcc and use clang
#5An even better reason to use clang: it supports Apple's new syntax for blocks. I'm trying to think of a new project to write in C now just to take advantage of the simple anonymous functions and closures that are possible.
Re: How to convince any C developer to dump gcc and use clang
#6In the second error message clang found that `horisontal` doesn't exist and suggested `horizontal`. That's fair enough. The last error message actually assumes the code said `horizontal`, which is just horribly wrong. I think that the compiler should never ever report an error on code that is not really there. What would happen if the programmer got a list of error and started fixing from the end? What if the guessed name was wrong? The programmer would spend time chasing some bug which doesn't exist outside of compiler's "that's what you probably meant" version of code.
Re: How to convince any C developer to dump gcc and use clang
#7I'm not sure this screenshot is convincing. Do you see the last error message? In the second error message clang found that `horisontal` doesn't exist and suggested `horizontal`. That's fair enough. The last error message actually assumes the code said `horizontal`, which is just horribly wrong. I think that the compiler should never ever report an error on code that is not really there. What would happen if the prog…
Re: How to convince any C developer to dump gcc and use clang
#8I'm not sure this screenshot is convincing. Do you see the last error message? In the second error message clang found that `horisontal` doesn't exist and suggested `horizontal`. That's fair enough. The last error message actually assumes the code said `horizontal`, which is just horribly wrong. I think that the compiler should never ever report an error on code that is not really there. What would happen if the prog…
I always fix the first 1 or 2 reported errors and try to recompile. I assume everyone did. A traditional "report on errors which are actually there each time they happen" compiler will give you tons of completely spurious errors which happily disappear once you fix the first few.
In the instance you point out, it could just uselessly say "no member named horisontal" but it knows it already gave you that error. So instead of repeating itself or shutting up, it reasons in the alternative--even if the name was corrected, the type is wrong. I would actually find that far more useful for fixing all the compiler errors at once.
Re: How to convince any C developer to dump gcc and use clang
#9Re: How to convince any C developer to dump gcc and use clang
#10I've been using gcc for a while now, and every time I use it I found a new feature. It's rock solid and had never let me down.