Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
* [RFA] Fix compilation failure on cygwin due to ncurses macro.
@ 2010-04-13  8:56 Pierre Muller
  2010-04-13 11:38 ` Pedro Alves
  0 siblings, 1 reply; 16+ messages in thread
From: Pierre Muller @ 2010-04-13  8:56 UTC (permalink / raw)
  To: gdb-patches

  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  <muller@ics.u-strasbg.fr>

	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);


^ permalink raw reply	[flat|nested] 16+ messages in thread

end of thread, other threads:[~2010-04-20 15:45 UTC | newest]

Thread overview: 16+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-04-13  8:56 [RFA] Fix compilation failure on cygwin due to ncurses macro Pierre Muller
2010-04-13 11:38 ` Pedro Alves
2010-04-13 12:13   ` Pierre Muller
2010-04-13 15:07     ` Joel Brobecker
2010-04-13 15:17       ` Pierre Muller
2010-04-13 15:26         ` Joel Brobecker
2010-04-14 11:08           ` Pierre Muller
2010-04-14 16:00             ` Joel Brobecker
2010-04-14 16:30               ` Pierre Muller
2010-04-14 16:33                 ` Joel Brobecker
2010-04-14 16:39                 ` Pedro Alves
2010-04-15  8:09                   ` Pierre Muller
2010-04-15 15:53                     ` Joel Brobecker
2010-04-15 22:38                       ` [RFC] Use macro for void typecast necessary for ncurses library Pierre Muller
2010-04-16  4:36                         ` Joel Brobecker
     [not found]                       ` <9120.2086922296$1271371097@news.gmane.org>
2010-04-20 15:45                         ` Tom Tromey

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox