[cfe-dev] patch for generalizing stdint for n-bit bytes

Ken Dyck Ken.Dyck at onsemi.com
Wed Nov 11 05:01:29 PST 2009


On Wednesday, November 04, 2009 6:04 PM, Chris Lattner wrote:
> 
> On Oct 30, 2009, at 5:41 AM, Ken Dyck wrote:
> 
> >>> 1. A simple reordering of typedefs in stdint.h (and
> >>> corresponding test cases) in anticipation of the next patch, 
> >>> which defines the types in order of decreasing width.
> >>> 2. Generalization of stdint.h for non-power-of-2 widths, along 
> >>> with necessary modifications to InitPreprocessor.cpp. Only minor
> >>> changes to test cases (where long is replaced by int in some 
> >>> typedefs on targets where they are the same width).
> >>> 3. Parameterization of SIG_ATOMIC
> >>> 4. Parameterization of limits on types that can be either signed 
> >>> or unsigned.
> >>> 5. Replace use of vector<char> for the definition buffer with a 
> >>> raw_ostream.
> >
> > Stage #1 patch attached. It is a simple reordering of the 
> definitions 
> > in stdint.h and introduces no new function changes.
> 
> Applied as r86062!
> 

Stage #2a attached. This adds definitions for types of 8-bit multiples
from 8 to 64 to stdint.h and rationalizes the selection of types for the
exact-width definitions in InitPreprocessor.cpp.

Only minimal changes have been made to the test cases:
- A 'signed' specifier is added to the type definitions where it was
unspecified before
- int32_t on PIC16 and MSP430 is now defined as 'long int' instead of
'long long' and int64_t on SystemZ is now 'long int' instead of 'long
long int'. These are all changes in types of equal width.

In stage #2b, I plan to parameterize the suffixes used by the
constant-generating macros in stdint.h, and use those macros to define
the limits of the integer types.

-Ken
-------------- next part --------------
A non-text attachment was scrubbed...
Name: stdint-8-bit-multiples.r86691.patch
Type: application/octet-stream
Size: 35385 bytes
Desc: stdint-8-bit-multiples.r86691.patch
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20091111/04beef82/attachment.obj>


More information about the cfe-dev mailing list