Follow @Openwall on Twitter for new release announcements and other news
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Date: Wed, 1 May 2013 13:05:03 -0400
From: "Z. Gilboa" <>
To: <>
Subject: sign (in)consistency between architectures


The current architecture-specific type definitions 
(arch/*/bits/alltypes.h) seem to entail the following inconsistent 
signed/unsigned types:

type      x86_64        i386
uid_t     unsigned      signed
gid_t     unsigned      signed
dev_t     unsigned      signed
clock_t   signed        unsigned

For *uid_t* and *gid_t*, the GNU documentation specifies /_unsigned int_://

For *dev_t*, the specification requires /_an integer type no narrower 
than int//_/: and given the value it is expected to hold (file device 
numbers), making it /_unsigned_/ seems to be the correct choice.

*clock_t* is defined as the value returned by clock(), and the manual 
page states that  "if the processor time used is not available or its 
value cannot be represented, the function returns the value (clock_t) 
-1."  This in turn suggests that clock_t should be a _signed_ type.

/As an additional reference, attached is the output generated by 
musl-alltypes (posted on April 18) for the above architectures.
/Best regards,

Content of type "text/html" skipped

View attachment "musl-alltypes.i386" of type "text/plain" (5875 bytes)

View attachment "musl-alltypes.x86_64" of type "text/plain" (5875 bytes)

Powered by blists - more mailing lists

Confused about mailing lists and their use? Read about mailing lists on Wikipedia and check out these guidelines on proper formatting of your messages.