[cfe-dev] clang comparison webpage
Alp Toker
alp at nuanti.com
Mon Dec 9 07:50:55 PST 2013
On 08/12/2013 23:20, Mouse wrote:
> http://clang.llvm.org/comparison.html compares clang versus three other
> compilers, one of them gcc, and invites mail to cfe-dev "if you think
> some characterization is unfair here".
>
> But the comparison to gcc leaves off the major reason clang is a
> complete nonstarter for me: lack of support for gcc extensions. (In my
> case nested function support is the biggest one; clang appears to be
> under the impression that they are "infrequently used"
On this matter specifically, clang is a lot better set up nowadays to
parse the old GNU nested functions thanks to work that was done do
support closures like blocks and other function declarators that appear
in funny places.
I just tried and you can get them to parse with a one-line change in
clang/lib/Parse/ParseDecl.cpp, and you can get some degree of semantic
support for nested variable scope with another small change to
ScopeInfo.h and SemaDecl.cpp. Probably with one more tweak to
lib/CodeGen you could get this up and running.
I think the policy not to support this extension made sense in the early
days, but since then we've added support for all kinds of good (and
dubious) extensions from GCC, MSVC and others so this is small fry.
So if there is a good case for it and someone volunteers their weekend
to implement it complete with tests, I can't imagine there would be
vociferous objection from current maintainers of the code to be honest.
Alp.
> , which, true or
> not in general, is not true of my code.)
>
> Not that it's a screaming big deal. But I do think it's at least
> somewhat unfair to gcc to fail to at least mention clang's lack of
> support for some of gcc's extensions when comparing the two.
>
> /~\ The ASCII Mouse
> \ / Ribbon Campaign
> X Against HTML mouse at rodents-montreal.org
> / \ Email! 7D C8 61 52 5D E7 2D 39 4E F1 31 3E E8 B3 27 4B
> _______________________________________________
> cfe-dev mailing list
> cfe-dev at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev
--
http://www.nuanti.com
the browser experts
More information about the cfe-dev
mailing list