[PATCH v2 00/14] predefined macros for intmax_t/intptr_t/...

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Some types have already their TYPE/SIZEOF/MAX macros.
These patches add them for the missing types: ptrdiff,
int{ptr,max,64,32,16,8}_t and their unsigned version.

Note: some of the types vary a lot depending on the
      architecture, OS & exact ABI used. This is
      specially the case for for int32_t.
      The definition in these patches should be correct
      for the most common archs & ABI used for the kernel
      but it can't possibly be correct for all cases.

Changes since v1:
* correct _MAX value of unsigned types (+ testing)
* fix definition PTYPE_WIDTH/PTYPE_TYPE
* fix inverted type for INT8/UINT8
* define shortcut PTYPE_ALL_T
* add tests for PTRDIFF/SIZE/INTMAX/INT{8,16,32,64}
* add definitions for wint_t, char16_t & char32t
Many thanks to Ramsay Jones for v1's review.


This series is available for review & testing in the repository at:
  git://github.com/lucvoo/sparse-dev.git predefs-v2

----------------------------------------------------------------
Luc Van Oostenryck (14):
      testsuite: test predef macros on LP32/LP64/LLP64
      fix '__SIZE_TYPE__' for LLP64
      allow optional "_T" suffix to __SIZEOF_XXX__
      use bits_mask() for predefined_max()
      add builtin_type_suffix()
      make predefined_type_size() more generic
      give a type to wchar
      add predefined macros for wint_t
      add predefined macros for [u]intptr
      add predefined macros for [u]intmax
      add predefined macros for [u]int{8,16}_t
      add predefined macros for [u]int64_t
      add predefined macros for [u]int32_t
      add predefined macros for char{16,32}_t

 char.c                                    |   4 +-
 lib.c                                     | 135 +++++++++++++++++++++---------
 show-parse.c                              |  73 +++++++++-------
 symbol.h                                  |   1 +
 target.c                                  |  10 ++-
 target.h                                  |  10 ++-
 validation/preprocessor/predef-char-bit.c |  16 ----
 validation/preprocessor/predef-llp64.c    |   9 ++
 validation/preprocessor/predef-lp32.c     |   9 ++
 validation/preprocessor/predef-lp64.c     |   9 ++
 validation/preprocessor/predef-max.c      |  18 ----
 validation/preprocessor/predef-sizeof.c   |  25 ------
 validation/preprocessor/predef.c          |  57 +++++++++++++
 13 files changed, 239 insertions(+), 137 deletions(-)
 delete mode 100644 validation/preprocessor/predef-char-bit.c
 create mode 100644 validation/preprocessor/predef-llp64.c
 create mode 100644 validation/preprocessor/predef-lp32.c
 create mode 100644 validation/preprocessor/predef-lp64.c
 delete mode 100644 validation/preprocessor/predef-max.c
 delete mode 100644 validation/preprocessor/predef-sizeof.c
 create mode 100644 validation/preprocessor/predef.c



[Index of Archives]     [Newbies FAQ]     [LKML]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Trinity Fuzzer Tool]

  Powered by Linux