[RFA] Fix compilation failure on cygwin due to ncurses macro.
Pierre Muller
pierre.muller@ics-cnrs.unistra.fr
Tue Apr 13 15:17:00 GMT 2010
> -----Message d'origine-----
> De : gdb-patches-owner@sourceware.org [mailto:gdb-patches-
> owner@sourceware.org] De la part de Joel Brobecker
> Envoyé : Tuesday, April 13, 2010 5:07 PM
> À : Pierre Muller
> Cc : 'Pedro Alves'; gdb-patches@sourceware.org
> Objet : Re: [RFA] Fix compilation failure on cygwin due to ncurses
> macro.
>
> > Committed with your corrections.
>
> Just a request: Can you add a comment next to all the casts explaining
> why the cast is there? It's important so that someone seeing the cast
> does not scratch his head for too long...
Would this change be OK?
Any better description is equally OK for me...
Does it deserve a separate ChangeLog entry, or should I commit it
without ChangeLog entry?
Pierre
$ cvs diff -u -p tui/tui-regs.c tui/tui-stack.c
Index: tui/tui-regs.c
===================================================================
RCS file: /cvs/src/src/gdb/tui/tui-regs.c,v
retrieving revision 1.37
diff -u -p -r1.37 tui-regs.c
--- tui/tui-regs.c 13 Apr 2010 12:11:09 -0000 1.37
+++ tui/tui-regs.c 13 Apr 2010 15:14:58 -0000
@@ -541,6 +541,8 @@ tui_display_register (struct tui_data_el
int i;
if (data->highlight)
+ /* Typecast to void is needed because some ncurses macros expand to
code
+ generating a warning about an unused value otherwise. */
(void) wstandout (win_info->handle);
wmove (win_info->handle, 0, 0);
@@ -551,6 +553,8 @@ tui_display_register (struct tui_data_el
waddstr (win_info->handle, data->content);
if (data->highlight)
+ /* Typecast to void is needed because some ncurses macros expand to
code
+ generating a warning about an unused value otherwise. */
(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.35
diff -u -p -r1.35 tui-stack.c
--- tui/tui-stack.c 13 Apr 2010 12:11:10 -0000 1.35
+++ tui/tui-stack.c 13 Apr 2010 15:14:58 -0000
@@ -256,9 +256,13 @@ tui_show_locator_content (void)
string = tui_make_status_line (&element->which_element.locator);
wmove (locator->handle, 0, 0);
+ /* Typecast to void is needed because some ncurses macros expand to
code
+ generating a warning about an unused value otherwise. */
(void) wstandout (locator->handle);
waddstr (locator->handle, string);
wclrtoeol (locator->handle);
+ /* Typecast to void is needed because some ncurses macros expand to
code
+ generating a warning about an unused value otherwise. */
(void) wstandend (locator->handle);
tui_refresh_win (locator);
wmove (locator->handle, 0, 0);
More information about the Gdb-patches
mailing list