Skip to content

Commit d9edb3f

Browse files
committed
testcurs.c : if wattr_set() is a macro, ignoring its return value can cause gcc to emit a warning when built with gcc and ncurses (see issue #364). Casting the return value to (void) essentially tells the compiler that we are intentionally ignoring the return value.
1 parent a2df00c commit d9edb3f

1 file changed

Lines changed: 5 additions & 5 deletions

File tree

demos/testcurs.c

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1557,14 +1557,14 @@ void attrTest(WINDOW *win)
15571557
mvaddstr(tmarg + 15, col1, "A_STRIKEOUT");
15581558
#endif
15591559

1560-
attr_set( WA_TOP, 0, NULL);
1560+
(void)attr_set( WA_TOP, 0, NULL);
15611561
mvaddstr(tmarg + 15, col2, "A_TOP");
15621562

1563-
attr_set( WA_DIM, 0, NULL);
1563+
(void)attr_set( WA_DIM, 0, NULL);
15641564
mvaddstr(tmarg + 17, col2, "A_DIM");
15651565

15661566
#ifdef WA_ITALIC
1567-
attr_set( WA_ITALIC | WA_UNDERLINE, 0, NULL);
1567+
(void)attr_set( WA_ITALIC | WA_UNDERLINE, 0, NULL);
15681568
mvaddstr(tmarg + 3, col2, "Underlined Italic");
15691569
#endif
15701570

@@ -1574,10 +1574,10 @@ void attrTest(WINDOW *win)
15741574
attrset( A_BLINK | A_UNDERLINE);
15751575
mvaddstr(tmarg + 7, col2, "Underlined Blink");
15761576

1577-
attr_set( WA_LEFT, 0, NULL);
1577+
(void)attr_set( WA_LEFT, 0, NULL);
15781578
mvaddstr(tmarg + 9, col2, "A_LEFT");
15791579

1580-
attr_set( WA_RIGHT, 0, NULL);
1580+
(void)attr_set( WA_RIGHT, 0, NULL);
15811581
mvaddstr(tmarg + 11, col2, "A_RIGHT");
15821582

15831583
attrset(A_BLINK|A_REVERSE);

0 commit comments

Comments
 (0)