[PATCH] stdint.h should use the target's types, cleanup the targets

David Majnemer david.majnemer at gmail.com
Thu Oct 24 17:29:13 PDT 2013


Hi eli.friedman, joerg, asl, atanasyan, jmolloy, t.p.northover, bkramer,

We would not choose the proper type for [u]intptr_t if we were
targeting -ffreestanding mode because we were substituting an equally
sized type, not the exact type.

An examination of Basic/Targets.cpp showed an irregular smattering of
target choices where we would get things wrong.  This code has been
reoriented around Operating Systems since they are largely uniform
outside of ILP32-LLP64 differences.

This has found a few notable bugs:
- MIPS and ARM would have their size_t as int and their ptrdiff_t as
  long
- aarch64 on Linux had it's 64-bit type set as 'long long' instead of as
  long

http://llvm-reviews.chandlerc.com/D2021

Files:
  lib/Basic/Targets.cpp
  lib/Headers/stdint.h
  lib/Sema/SemaType.cpp
  test/Preprocessor/init.c
  test/Preprocessor/stdint.c
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D2021.1.patch
Type: text/x-patch
Size: 21736 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20131024/edc7ab49/attachment.bin>


More information about the cfe-commits mailing list