Are there any plans for testing compilations of the headers on the various platforms?
I would like to look into getting Visual Studio and Windows headers to compile, and the first step would be to see where we are.
I’m thinking that if we had some tests that just include individual headers and just syntax check them, that would both give us this information, as well as become a regression test.
What I’ve done locally is to create an “Includes” directory under “test”, and put in simple tests of the form:
// RUN: clang -fsyntax-only %s
#include <stdio.h>
I’m using the clang driver because of the -fms-extension issue.
Since headers might act differently between C and C++, perhaps each test should have two compile commands, one for C and one for C++. (I haven’t figured out the right options to do that yet with the clang driver.)
Since stdio.h might include other files, I test those separately. Since these might be platform-specific, I’d use conditionals:
// This test is for Windows only.
// RUN: clang -fsyntax-only %s
#if defined(WIN32) || defined(WIN64)
#include <crtdefs.h>
#endif
Platform and complier-specific files probably should be in separate directories, perhaps under Includes, i.e.:
test
Includes
VisualStudio
Windows
GNU
I separated VisualStudio and Windows with respect to the files under Visual Studio and those under the Platform SDK also being separated, but they could be combined.
Anyway, let me know what you think.