From patchwork Tue Dec 30 00:04:20 2014
Content-Type: text/plain; charset="utf-8"
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
X-Patchwork-Submitter: =?utf-8?q?P=C3=A1draig_Brady?=
X-Patchwork-Id: 4455
Received: (qmail 25076 invoked by alias); 30 Dec 2014 00:04:29 -0000
Mailing-List: contact libc-alpha-help@sourceware.org; run by ezmlm
Precedence: bulk
List-Id:
List-Unsubscribe:
List-Subscribe:
List-Archive:
List-Post:
List-Help: ,
Sender: libc-alpha-owner@sourceware.org
Delivered-To: mailing list libc-alpha@sourceware.org
Received: (qmail 25064 invoked by uid 89); 30 Dec 2014 00:04:26 -0000
Authentication-Results: sourceware.org; auth=none
X-Virus-Found: No
X-Spam-SWARE-Status: No, score=-1.9 required=5.0 tests=AWL, BAYES_00,
RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.2
X-HELO: mail2.vodafone.ie
X-IronPort-Anti-Spam-Filtered: true
X-IronPort-Anti-Spam-Result:
AlMFANXqoVRtTWMs/2dsb2JhbABcDoJ4hC/HEIJVAoELFgEBAQEBfYQNAQUjDwFGEAsNAQoCAgUWCwICCQMCAQIBRQYBDAEHAQGILAGuN4Vpjn0BAQEBBgEBAQEBHYEhjlYHgmiBQQWdIos2IoMxPT6CdAEBAQ
Message-ID: <54A1EC04.8020103@draigBrady.com>
Date: Tue, 30 Dec 2014 00:04:20 +0000
From: =?UTF-8?B?UMOhZHJhaWcgQnJhZHk=?=
User-Agent: Mozilla/5.0 (X11; Linux x86_64;
rv:31.0) Gecko/20100101 Thunderbird/31.3.0
MIME-Version: 1.0
To: Eric Blake , Paul Eggert ,
Alan Modra
CC: libc-alpha@sourceware.org, bug-gnulib@gnu.org
Subject: Re: [PATCH 0/5] obstacks again
References: <20141029033201.GI4267@bubble.grove.modra.org>
<5450983F.3030608@cs.ucla.edu> <20141029220223.GP4267@bubble.grove.modra.org>
<5451B1F6.7060305@cs.ucla.edu>
<548203C3.6040601@redhat.com>
In-Reply-To: <548203C3.6040601@redhat.com>
On 05/12/14 19:13, Eric Blake wrote:
> On 10/29/2014 09:35 PM, Paul Eggert wrote:
>> Alan Modra wrote:
>>
>>> One thing though, I didn't put the ChangeLog diffs in the patch as I
>>> usually add them when committing.
>>
>> Oh, I missed that. I added them now. For Gnulib it's better to put
>> them into the patch.
>>
>>> It is no longer possible to shrink an obstack with obstack_blank (but
>>> you can still do that with obstack_blank_fast).
>>
>> Ouch, I hadn't noticed that. That's an incompatible change and I expect
>> it will break real-world usage for no particularly good reason, so we
>> really need to fix this. How about making the 2nd argument to
>> obstack_blank and obstack_blank_fast be of type ptrdiff_t rather than
>> size_t?
>
> It breaks GNU M4, for a starter :) But at least we predicted that it
> would happen, and I'm hoping the fallback of obstack_blank_fast does the
> job.
For reference ls is also impacted. Hopefully this suffices:
thanks,
Pádraig.
diff --git a/src/ls.c b/src/ls.c
index 82402ee..5bee5e6 100644
--- a/src/ls.c
+++ b/src/ls.c
@@ -990,7 +990,7 @@ dev_ino_pop (void)
struct dev_ino *di;
int dev_ino_size = sizeof *di;
assert (dev_ino_size <= obstack_object_size (&dev_ino_obstack));
- obstack_blank (&dev_ino_obstack, -dev_ino_size);
+ obstack_blank_fast (&dev_ino_obstack, -dev_ino_size);
vdi = obstack_next_free (&dev_ino_obstack);
di = vdi;
return *di;