Re: [PATCH v4 0/4] predefined macros for intmax_t/intptr_t/...

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

 




On 17/12/2018 00:02, Luc Van Oostenryck wrote:
> 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 now be correct
>       for the most common archs & ABI used for the kernel.
> 
>       It seems now to be correct and complete (for Linux)
>       on x86-64, i386, ppc64 & arm64.
> 
> Changes since v1:
> * correct _MAX value of unsigned types (+ testing)
> * fix definition PTYPE_WIDTH/PTYPE_TYPE
> * fix inverted type for INT8/UINT8
> * define shortcur PTYPE_ALL_T
> * add tests for PTRDIFF/SIZE/INTMAX/INT{8,16,32,64}
> * add definitions for wint_t, char16_t & char32t
> 
> Changes since v2:
> * mv slong_ctype's entry in typenames after long_ctype
> * use the type for predefined_max()
> * add a temptative arch_mach initialized with the native
>   architecture and use it to set more correctly wchar_t,
>   int32_t, ...
> * fix size of long double, especially on x86-64
> 
> Change since v3:
> * SCHAR must refer to schar_ctype, not the plain char_ctype
> * remove now unneeded #ifdefery to initialize int32_t
> * add predefine for __CHAR_UNSIGNED__
> * add predefine for __{WCHAR,WINT}_MIN__
> 
> To make clearer what changed since v3, only the delta and new
> patches are posted.

Ah, sorry Luc, but I didn't manage to do much testing this
weekend after all (_many_ higher priority interrupts!).

I did manage _some_ testing, first with the v3 patches based
on the 'master' branch from a couple of days ago. Then I saw
the 'master' branch gained some additional patches, so I rebased
the v3 patches on top (of 'master' @ 5532461), which had a
minor text conflict (which was automatically resolved by rebase).

So, I will add these on top tonight ... (but I still have some
other things I need to do as well :( ).

So, with the limited testing of v3, I noticed that (on Linux) the
gcc '-mx32' mode differed from sparse in the size of a 'long double',
which was 16 on gcc and 12 on sparse.

As previously noted, on cygwin WCHAR is an 'unsigned short'. Also, the
gcc '-mx32' mode on cygwin is useless (probably unsupported/not defined).
Indeed, the '-mx32' mode on Linux requires kernel support, which the
fedora project are talking about removing soon. (apparently, nobody
uses it anyway!).

I will try to get to this testing soon. (but I would not be unhappy
if you pushed this out, as it stands, and go 'incremental' with any
additional 'fixes'). :-D

ATB,
Ramsay Jones





[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