From patchwork Tue Feb 24 05:18:23 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mike Frysinger X-Patchwork-Id: 442801 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 C344814016B for ; Tue, 24 Feb 2015 16:18:41 +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:from:to:subject:date:message-id; q=dns; s= default; b=Vj8v6hARxCprFZ2OdmnDNXgsO9tDs6KmKxd+KwYSgfkYc0IuKYLHx Rn6w/LbaxI1PsjyS9w/fSo0n+HlPHFLblKi+1E+hIZIF+HcZMQBsReqUi3grngOr l85B72fVNa8H7V7PDOVmHB1TjlcV/pyVDRj32nxbqghCJbP60/aVAA= 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:from:to:subject:date:message-id; s=default; bh=3rZW+5ncaVQkVpleO8tWDp56vR8=; b=A+E7VGQUrGo2jvDCkjZdttacLPXL QEymUl9KxzQ7lS6PM1gkA6YYWr4cs/0W2SsfzoMsscwuNy0XoHgr2hEl5hXMg2mQ xGe7R16j9c8YZYlujfm5x5U1UtLK2dFtU7wkBBA8P4hsDARa0Djrx4+sEYIzNBbI 0db8eL6k+FIUuB8= Received: (qmail 10506 invoked by alias); 24 Feb 2015 05:18:34 -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 10450 invoked by uid 89); 24 Feb 2015 05:18:29 -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, SPF_PASS, T_RP_MATCHES_RCVD autolearn=ham version=3.3.2 X-HELO: smtp.gentoo.org From: Mike Frysinger To: libc-alpha@sourceware.org Subject: [PATCH] alloca: fix buf interaction Date: Tue, 24 Feb 2015 00:18:23 -0500 Message-Id: <1424755103-20378-1-git-send-email-vapier@gentoo.org> The stack-grows-down case is missing paren around the buf cast. The stack-grows-up case is missing a cast with the buf assignment. This leads to build failures due to -Werror: vfprintf.c: In function '_IO_vfprintf_internal': vfprintf.c:1738:16: error: initialization from incompatible pointer type [-Werror] 2015-02-24 Mike Frysinger * include/alloca.h [_STACK_GROWS_DOWN] (extend_alloca): Add parenthesis around the buf assignment. [_STACK_GROWS_UP] (extend_alloca): Add a char* cast. --- include/alloca.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/include/alloca.h b/include/alloca.h index f741d25..0150025 100644 --- a/include/alloca.h +++ b/include/alloca.h @@ -28,7 +28,7 @@ libc_hidden_proto (__libc_alloca_cutoff) # define extend_alloca(buf, len, newlen) \ (__typeof (buf)) ({ size_t __newlen = stackinfo_alloca_round (newlen); \ char *__newbuf = __alloca (__newlen); \ - if (__newbuf + __newlen == (char *) buf) \ + if (__newbuf + __newlen == (char *) (buf)) \ len += __newlen; \ else \ len = __newlen; \ @@ -37,7 +37,7 @@ libc_hidden_proto (__libc_alloca_cutoff) # define extend_alloca(buf, len, newlen) \ (__typeof (buf)) ({ size_t __newlen = stackinfo_alloca_round (newlen); \ char *__newbuf = __alloca (__newlen); \ - char *__buf = (buf); \ + char *__buf = (char *) (buf); \ if (__buf + len == __newbuf) \ { \ len += __newlen; \