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: 7808 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)