This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[RFA] Fix compilation failure on cygwin due to ncurses macro.


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]