From patchwork Thu Jul 23 08:17:28 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stefan Liebler X-Patchwork-Id: 499245 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 44C5B140D19 for ; Thu, 23 Jul 2015 18:17:46 +1000 (AEST) Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; secure) header.d=sourceware.org header.i=@sourceware.org header.b=eqotruhF; dkim-atps=neutral DomainKey-Signature: a=rsa-sha1; c=nofws; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:to:from:subject:date:message-id:mime-version :content-type; q=dns; s=default; b=ao93/JqdRLAfcbuvcazQ3i1cK+YKj oaAjV0Zenn+KJd2BvBJFRGicHxab+Y9lEp71rpgAJWsC2vPSPwbcb97av0Hkk5dm 7eO3CRZ+U+J7LVC+xOQaoC6KQfOahqdXyvrFP5b/U/U8BR40png7RObU81izExwc E2j2kLO4QOdDuM= 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:to:from:subject:date:message-id:mime-version :content-type; s=default; bh=1SAevGBpKHfzUE9fe2C6/mTEEtY=; b=eqo truhFFmLxC2B2UDWMRBL6AQ1z5wBdKjIe5G8FEBbXxah+wCJLrc/sr/CJGgO6N7X FjKjR+1uz/APD6n27xl0kbGeYJh3vFyLoxowNxSQLPdJlqUmPANcLAJww7jfiA73 h39rP5f8Z3I/brbs6GJVEPJe3Hb8VnHLeB0vJ16w= Received: (qmail 95790 invoked by alias); 23 Jul 2015 08:17:40 -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 95779 invoked by uid 89); 23 Jul 2015 08:17:39 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-3.2 required=5.0 tests=AWL, BAYES_00, RCVD_IN_DNSWL_LOW, RP_MATCHES_RCVD, SPF_HELO_PASS, SPF_PASS autolearn=ham version=3.3.2 X-HELO: plane.gmane.org To: libc-alpha@sourceware.org From: Stefan Liebler Subject: [PATCH] s390: Fix build warning with gcc6 in jmpbuf-unwind.h. Date: Thu, 23 Jul 2015 10:17:28 +0200 Lines: 67 Message-ID: Mime-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.7.0 Hi, I get the following warning while building glibc on s390-32 with gcc 6: In file included from unwind.c:26:0: unwind.c: In function 'unwind_stop': ../sysdeps/s390/jmpbuf-unwind.h:37:10: error: cast to pointer from integer of different size [-Werror=int-to-pointer-cast] (void *) (_Unwind_GetCFA (_context) \ ^ ../sysdeps/s390/jmpbuf-unwind.h:51:17: note: in definition of macro '_JMPBUF_UNWINDS_ADJ' ((uintptr_t) (_address) - (_adj) < _jmpbuf_sp (_jmpbuf) - (_adj)) ^ unwind.c:62:12: note: in expansion of macro '_JMPBUF_CFA_UNWINDS_ADJ' || ! _JMPBUF_CFA_UNWINDS_ADJ (buf->cancel_jmp_buf[0].jmp_buf, context, _Unwind_GetCFA returns an _Unwind_Word which is an unsigned with a size of 4 bytes on s390-32 and 8 bytes on s390-64. This patch casts _Unwind_GetCFA return to _Unwind_Ptr first and afterwards to a void pointer as it is done in nptl/unwind.c:72, too. This removes the int-to-pointer-cast warning. Ok for 2.22 or later? Bye Stefan --- 2015-07-23 Stefan Liebler * sysdeps/s390/jmpbuf-unwind.h (_JMPBUF_CFA_UNWINDS_ADJ): Cast return of _Unwind_GetCFA to _Unwind_Ptr first. diff --git a/sysdeps/s390/jmpbuf-unwind.h b/sysdeps/s390/jmpbuf-unwind.h index b7b6b9d..cb33aee 100644 --- a/sysdeps/s390/jmpbuf-unwind.h +++ b/sysdeps/s390/jmpbuf-unwind.h @@ -32,10 +32,10 @@ /* On s390{,x}, CFA is always 96 (resp. 160) bytes above actual %r15. */ -#define _JMPBUF_CFA_UNWINDS_ADJ(_jmpbuf, _context, _adj) \ - _JMPBUF_UNWINDS_ADJ (_jmpbuf, \ - (void *) (_Unwind_GetCFA (_context) \ - - 32 - 2 * __WORDSIZE), _adj) +#define _JMPBUF_CFA_UNWINDS_ADJ(_jmpbuf, _context, _adj) \ + _JMPBUF_UNWINDS_ADJ (_jmpbuf, \ + (void *) (_Unwind_Ptr) (_Unwind_GetCFA (_context) \ + - 32 - 2 * __WORDSIZE), _adj) static inline uintptr_t __attribute__ ((unused)) _jmpbuf_sp (__jmp_buf regs)