Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: "Pierre Muller" <pierre.muller@ics-cnrs.unistra.fr>
To: <gdb-patches@sourceware.org>
Subject: [RFA] Fix compilation failure on cygwin due to ncurses macro.
Date: Tue, 13 Apr 2010 08:56:00 -0000	[thread overview]
Message-ID: <003001cadae7$2e639860$8b2ac920$@muller@ics-cnrs.unistra.fr> (raw)

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


             reply	other threads:[~2010-04-13  8:56 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-04-13  8:56 Pierre Muller [this message]
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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='003001cadae7$2e639860$8b2ac920$@muller@ics-cnrs.unistra.fr' \
    --to=pierre.muller@ics-cnrs.unistra.fr \
    --cc=gdb-patches@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox