Small patch to get clang working on Minix 3

Hi,

I'm porting llvm and clang to Minix 3 (www.minix3.org). Clang 2.6 was easy to port, I only needed to add one #include, see the attached patch.

It would be nice if this patch could be incorporated in clang.

Sincerely,

clang-diffs (659 Bytes)

Should be replaced with <cstdint>, no?

Hi,

I'm porting llvm and clang to Minix 3 (www.minix3.org). Clang 2.6 was easy to port, I only needed to add one #include, see the attached patch.

It would be nice if this patch could be incorporated in clang.

Does this still occur on mainline? What error do you get?

-Chris

Hello

+#include <stdint.h>

We cannot used stdint.h include - this file does not exist with VCPP
(also, you don't use the proper order of includes, etc.).
You should at least use Support/DataTypes.h. However, the problem is
definitely somewhere else, such include just masks the real problem.

Hi,

Thanks for all the replies to my earlier email. Sorry for the late reply.

The problem I'm trying to solve is that in Basic/Diagnostic.h I get complaints that intptr_t is unknown. I have now added
#include "llvm/Support/DataTypes.h"

instead of <stdint.h>, and this also solves the problem.

I don't understand why you say that the problem is somewhere else. The type intptr_t is used in basic/Diagnostic.h, and none of the original includes looks like something that should define intptr_t. Is it perhaps convention to use Basic/Diagnostic.h only when it is guaranteed that intptr_t is defined? That seems unlikely to me.

It seems to me that the #include I add enhances portability, because otherwise the compilation relies on stdint.h (or equivalent) to be included as a side-effect.

BTW,
grepping on stdint.h in the clang source tree shows that there are 9 source files with
#include <stdint.h>
but I also note that there is a stdint.h in lib/Headers. Perhaps my #include <stdint.h> in Basic/Diagnostic.h pulled in that one. I don't know enough about clang header files to understand what's going on there.