From patchwork Fri Dec 5 18:02:09 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Adhemerval Zanella X-Patchwork-Id: 418260 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 1D50614010F for ; Sat, 6 Dec 2014 05:02:27 +1100 (AEDT) DomainKey-Signature: a=rsa-sha1; c=nofws; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:message-id:date:from:mime-version:to:cc :subject:references:in-reply-to:content-type :content-transfer-encoding; q=dns; s=default; b=hirNhkmugAi0smkg 8LYU1gkGQbdpiNr8Khr18SYIdVJJErCxl9PnVmnupqFpwvpySV8QbhtWPDpGrPES p/Q8vAM6jvuCvmf38F67C5wGWU4LqjXidqxgee0YqsL4z8Y44DTdzdsyj6kBmENP DU3+qLcQdSrnBnYnGaldZq+nGTM= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:message-id:date:from:mime-version:to:cc :subject:references:in-reply-to:content-type :content-transfer-encoding; s=default; bh=r95vjXJ+QttrCCFUVYXces TIOMI=; b=Xpa01G/oVsk4+UsKgDoU2y9vHlYOev7+hYfJcWVgaip3GNopy8UFD1 30lJOCX8bEqpzI4dcP2Dudiicq1Z2tkc9f5SIoD2tgJXqoTrYcqA+Ty5qVDRU4ao T787/+l0aZseoJKyidh8wVcfevyIkWtcn9zj8afbSs9phxl1kc5/c= Received: (qmail 5174 invoked by alias); 5 Dec 2014 18:02:22 -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 5141 invoked by uid 89); 5 Dec 2014 18:02:20 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.1 required=5.0 tests=AWL, BAYES_00, T_RP_MATCHES_RCVD autolearn=ham version=3.3.2 X-HELO: e24smtp01.br.ibm.com Message-ID: <5481F321.1080907@linux.vnet.ibm.com> Date: Fri, 05 Dec 2014 16:02:09 -0200 From: Adhemerval Zanella User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Thunderbird/24.5.0 MIME-Version: 1.0 To: libc-alpha@sourceware.org CC: "Carlos O'Donell" Subject: Re: [PATCH v2] ftell: seek to end only when there are unflushed bytes (BZ #17647) References: <20141125155404.GO12197@spoyarek.pnq.redhat.com> <547FC7C7.4030000@redhat.com> <54805EAD.3000605@linux.vnet.ibm.com> <54808488.1050602@redhat.com> <54809D11.5040406@linux.vnet.ibm.com> <54819F98.5080102@linux.vnet.ibm.com> <87d27yoyjv.fsf@igel.home> <5481DEBD.8060507@linux.vnet.ibm.com> <87388uowbk.fsf@igel.home> In-Reply-To: <87388uowbk.fsf@igel.home> X-TM-AS-MML: disable X-Content-Scanned: Fidelis XPS MAILER x-cbid: 14120518-1524-0000-0000-0000013D1EF3 On 05-12-2014 15:11, Andreas Schwab wrote: > Adhemerval Zanella writes: > >> On 05-12-2014 14:23, Andreas Schwab wrote: >>> Adhemerval Zanella writes: >>> >>>> @@ -364,11 +365,11 @@ do_ftell_test (const char *filename) >>>> reading. */ >>>> if (test_modes[i].fd_mode != O_WRONLY) >>>> { >>>> - char tmpbuf[data_len]; >>>> + char tmpbuf[data_len * char_len]; >>> tmpbuf may not be aligned for wchar_t. >> But I can't see why this won't allocate enough space for further operations. > Where did I say that? > >> Care to explain? > Alignment and size are separate properties of an object. > > Andreas. > I see now my mistake. What about: PS: thanks Carlos for the clarification. diff --git a/libio/tst-ftell-active-handler.c b/libio/tst-ftell-active-handler.c index 44a4fac..0bd9d01 100644 --- a/libio/tst-ftell-active-handler.c +++ b/libio/tst-ftell-active-handler.c @@ -365,7 +365,8 @@ do_ftell_test (const char *filename) reading. */ if (test_modes[i].fd_mode != O_WRONLY) { - char tmpbuf[data_len * char_len]; + char tmpbuf[data_len * char_len] + __attribute__ ((__aligned__ (__alignof__ (wchar_t)))); rewind (fp);