From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 9238 invoked by alias); 13 Apr 2010 08:56:19 -0000 Received: (qmail 9227 invoked by uid 22791); 13 Apr 2010 08:56:17 -0000 X-SWARE-Spam-Status: No, hits=-1.8 required=5.0 tests=BAYES_00,MSGID_MULTIPLE_AT,TW_LR X-Spam-Check-By: sourceware.org Received: from mailhost.u-strasbg.fr (HELO mailhost.u-strasbg.fr) (130.79.200.153) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Tue, 13 Apr 2010 08:56:13 +0000 Received: from baal.u-strasbg.fr (baal.u-strasbg.fr [IPv6:2001:660:2402::41]) by mailhost.u-strasbg.fr (8.14.3/jtpda-5.5pre1) with ESMTP id o3D8u93P030766 for ; Tue, 13 Apr 2010 10:56:10 +0200 (CEST) (envelope-from pierre.muller@ics-cnrs.unistra.fr) Received: from mailserver.u-strasbg.fr (ms2.u-strasbg.fr [IPv6:2001:660:2402:d::11]) by baal.u-strasbg.fr (8.14.0/jtpda-5.5pre1) with ESMTP id o3D8u9b6074563 for ; Tue, 13 Apr 2010 10:56:09 +0200 (CEST) (envelope-from pierre.muller@ics-cnrs.unistra.fr) Received: from d620muller (lec67-4-82-230-53-140.fbx.proxad.net [82.230.53.140]) (user=mullerp mech=LOGIN) by mailserver.u-strasbg.fr (8.14.3/jtpda-5.5pre1) with ESMTP id o3D8u8om033929 (version=TLSv1/SSLv3 cipher=RC4-MD5 bits=128 verify=NO) for ; Tue, 13 Apr 2010 10:56:09 +0200 (CEST) (envelope-from pierre.muller@ics-cnrs.unistra.fr) From: "Pierre Muller" To: Subject: [RFA] Fix compilation failure on cygwin due to ncurses macro. Date: Tue, 13 Apr 2010 08:56:00 -0000 Message-ID: <003001cadae7$2e639860$8b2ac920$@muller@ics-cnrs.unistra.fr> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org X-SW-Source: 2010-04/txt/msg00396.txt.bz2 I currently get compilation failures on cygwin (old 1.5 version) in tui/tui-regs.c on wstandout/wstandend ncurses functions. Using --save-temps, I found out that this is because wstandout is translated into: static void tui_display_register (struct tui_data_element *data, struct tui_gen_win_info *win_info) { if (win_info->handle != (WINDOW *) ((void *)0)) { int i; if (data->highlight) (((win_info->handle)->_attrs = (((1UL) << ((8) + 8))), (int)((win_info->handle) ->_attrs))); but the second part is not used. leading to an unused value warning transformed into an error. The wstandout macro comes from /usr/include/ncurses/ncurses.h version is "5.7" patch "20091114" Casting the calls of wstandout and wstandend to (void) fixed the compilation error for me. Is this patch OK? Pierre Muller Pascal language support maintainer for GDB 2010-04-13 Pierre Muller Suppress unused value warning during compilation . * tui/tui-regs.c (tui_display_register): Cast wstandout and wstandend calls to (void). * tui/tui-stack.c (tui_show_locator_content): Likewise. Index: tui/tui-regs.c =================================================================== RCS file: /cvs/src/src/gdb/tui/tui-regs.c,v retrieving revision 1.36 diff -u -p -r1.36 tui-regs.c --- tui/tui-regs.c 1 Jan 2010 07:32:07 -0000 1.36 +++ tui/tui-regs.c 13 Apr 2010 08:50:56 -0000 @@ -541,7 +541,7 @@ tui_display_register (struct tui_data_el int i; if (data->highlight) - wstandout (win_info->handle); + (void) wstandout (win_info->handle); wmove (win_info->handle, 0, 0); for (i = 1; i < win_info->width; i++) @@ -551,7 +551,7 @@ tui_display_register (struct tui_data_el waddstr (win_info->handle, data->content); if (data->highlight) - wstandend (win_info->handle); + (void) wstandend (win_info->handle); tui_refresh_win (win_info); } } Index: tui/tui-stack.c =================================================================== RCS file: /cvs/src/src/gdb/tui/tui-stack.c,v retrieving revision 1.34 diff -u -p -r1.34 tui-stack.c --- tui/tui-stack.c 1 Jan 2010 07:32:07 -0000 1.34 +++ tui/tui-stack.c 13 Apr 2010 08:50:56 -0000 @@ -256,10 +256,10 @@ tui_show_locator_content (void) string = tui_make_status_line (&element->which_element.locator); wmove (locator->handle, 0, 0); - wstandout (locator->handle); + (void) wstandout (locator->handle); waddstr (locator->handle, string); wclrtoeol (locator->handle); - wstandend (locator->handle); + (void) wstandend (locator->handle); tui_refresh_win (locator); wmove (locator->handle, 0, 0); xfree (string);