[cfe-dev] Cannot parse the Linux kernel

Eli Friedman eli.friedman at gmail.com
Fri Jun 12 13:28:20 PDT 2009


On Fri, Jun 12, 2009 at 7:20 AM, Roberto Bagnara<bagnara at cs.unipr.it> wrote:
> We are writing a program analyzer that should be able to analyze
> existing code in widespread use as it is.  Without having to patch
> it, no matter how insignificant the patch is.

Okay, I guess that makes sense.

> This should be compatible with the design goals of clang. Of course, if
> specific gcc constructs that are not implementable in clang are
> encountered, clang will have to give up.   But whenever  a fatal failure
> is avoidable, it should be avoided.  This is, IMHO, a key point for the
> success of clang and for the success of every project that uses it.

Well, it might be nice in some sense, I guess, but we have to draw the
line for sanity somewhere.
http://clang.llvm.org/docs/UsersManual.html#c_unsupp_gcc is a list of
stuff we're simply not intending to support; it's not set in stone,
but there are limits to how far we are planning to go for gcc
compatibility.

> In the specific case, we think that simply converting the fatal failure
> into a warning and matching the semantics of gcc is the best option.

If we could come up with some reasonable way to model gcc's behavior
for PR4236, we don't really even need to warn.  The issue is that we
don't want to accept code that doesn't make sense, and we don't want
to accept code we know IRGen can't deal with.

-Eli




More information about the cfe-dev mailing list