[cfe-dev] Raising LLVM minimum required, 'dumb question'

Reid Kleckner rnk at google.com
Tue Aug 26 15:46:07 PDT 2014

Your question isn't actually that clear. What kind of brokenness do you
care about? Are you looking for C++ that clang can't parse, or standard
library features that behave incompatibly on Windows?  I think you mean the

The answer to that question is complicated. It depends on what you want to
parse. I'd say there's several classes of stuff in order
of increasing difficulty to parse:
- Plain C Windows SDK headers: windows.h
- MSVC C++ STL headers: vector, string
- Templateless COM headers: DirectX etc
- Template libraries: ATL, WRL

The first three classes aren't that hard to parse. When they use standard
language features, they are mostly well-formed. The difficulty in parsing
them is that they use lots and lots of language extensions. The basic stuff
is dllexport and __stdcall, but it gets harder. There are weird IDL
attributes involving square brackets, for example.

The final category is really something all on its own. MSVC's template
model is drastically different from ours. You could hypothetically hack
these headers in probably 20 or so places to get them to parse with Clang
without any compatibility hacks, but you end up fighting an uphill battle.
This is the category that native GUI apps tend to have, while batch
processing apps like LLVM can get by with the first three sets.

On Tue, Aug 26, 2014 at 3:23 PM, James Gregurich <bayoubengal at mac.com>

> hi. thanks for the response.
> “we discussed that and it wasn’t the best approach” is good enough for me
> for now. I don’t have an immediate need, and the folks who looked at it
> likely know as much or more than I do about the subject. When I have some
> time to tinker, I’ll try it and see what I get and/or go dig into the
> archives to see what was said. if the answer to the question is in the
> archives, then there is no point to rehashing it.  To me, not knowing the
> history, the two obvious question weren’t being asked…WHAT exactly is
> “broken" in the headers and CAN it be bypassed with some some preprocessor
> game-playing?
> I wasn’t trying to a jerk. I just did’t like being shut down on what to me
> is a legitimate issue to hash out.
> -James
> On Aug 25, 2014, at 11:14 PM, Nikola Smiljanic <popizdeh at gmail.com> wrote:
> > Hi James, I'll bite the bullet by trying to paraphrase Chandler. I think
> that he was just trying to keep the discussion on topic. It happens quite
> often that someone has additional questions, like you in this case. But as
> Chandler pointed out, brokenness of platform headers on windows really
> doesn't have anything to do with minimum version of msvc needed to compile
> clang and that's what the discussion was all about.
> >
> > Please start a new thread and people will be more than happy to answer
> your questions. You can also try and search the archive for specific
> information on how broken the headers are, but I don't think any sort of
> wrapping can solve these issues, conforming compiler doesn't understand
> their dialect of C++, it's that simple.
> >
> _______________________________________________
> cfe-dev mailing list
> cfe-dev at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20140826/047744c3/attachment.html>

More information about the cfe-dev mailing list