[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Proposal: immediate strings
From: |
Dmitry Antipov |
Subject: |
Re: Proposal: immediate strings |
Date: |
Wed, 06 Jun 2012 10:14:06 +0400 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:12.0) Gecko/20120428 Thunderbird/12.0.1 |
On 05/31/2012 08:34 PM, Paul Eggert wrote:
Part of my misunderstanding was due to that the code confuses 'unsigned long'
with 'ptrdiff_t'. The two types need not be the same width.
The code should use 'sizeof (ptrdiff_t)' where it currently
uses 'sizeof (unsigned long)', and we need a BITS_PER_PTRDIFF_T
enum to size the fields correctly.
The problem with ptrdiff_t is that it's signed (and has no unsigned version),
and the code assumes that the bitfields are unsigned.
This raises the question which I wanted to raise long time ago: why ptrdiff_t
(read: signed difference between pointers) is used for size values, although
there is a special type ssize_t (and it's unsigned counterpart size_t)?
Dmitry
- Re: Proposal: immediate strings,
Dmitry Antipov <=