[cfe-dev] Reinstating stdint.h in test/CodeGen/const-init.c

Ken Dyck Ken.Dyck at onsemi.com
Thu Nov 19 11:26:30 PST 2009


In October (in r84160) the #include<stdint.h> in
test/CodeGen/const-init.c was replaced with an explicit definition of
intptr_t. From what I gather, this was done to get the test to succeed
on Windows, where a host stdint.h is not implemented and clang, in
hosted mode, blindly attempts to include one anyways.

Explicitly defining intptr_t in the file has the problem of relying on
the built-in macro, __INTPTR_TYPE__, which I would consider an
implementation detail of stdint.h, one that I'd like to remove (but I'll
save that discussion for another thread).

I'd like to propose an alternate fix. See the attached patch. It runs
the test in freestanding mode, forcing the inclusion of clang's stdint.h
instead looking for a hosted one. And, more importantly, it doesn't rely
on any built-in macros.

Thoughts?

-Ken

_____________________________
Ken Dyck
Senior Member of Technical Staff
Software Tools Development
Medical Division
ON Semiconductor
ken.dyck at onsemi.com
+1 519 884 9696 ext 2277 | office
+1 519 884 0228 | fax
http://onsemi.com
_____________________________
-------------- next part --------------
A non-text attachment was scrubbed...
Name: const-init-intptr-def.r89241.patch
Type: application/octet-stream
Size: 534 bytes
Desc: const-init-intptr-def.r89241.patch
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20091119/c43fabe7/attachment.obj>


More information about the cfe-dev mailing list