Skip to content

Commit

Permalink
emulators/elliott: fix unused but set variable
Browse files Browse the repository at this point in the history
During an exp-run for llvm 13 (see bug 258209), it turned out that
emulators/elliott fails to build with clang 13:

emulator.c:536:20: error: variable 'y' set but not used [-Werror,-Wunused-but-set-variable]
        int x, x1, y;
                   ^
1 error generated.

This is because x, x1 and y are used in ncurses getyx() macros, but in
this case the program is not interested in the y result. Mark it as
__unused to get rid of the warning.

PR:		258471
Approved by:	maintainer timeout (2 weeks)
MFH:		2021Q4
  • Loading branch information
DimitryAndric committed Oct 2, 2021
1 parent 0efce95 commit 9324aed
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions emulators/elliott-803/files/patch-emulator_emulator.c
@@ -0,0 +1,11 @@
--- emulator/emulator.c.orig 2020-11-27 12:36:20 UTC
+++ emulator/emulator.c
@@ -533,7 +533,7 @@ bool handle_key(commands_t *cmd,
wch[0] = c;
wch[1] = L'\0';

- int x, x1, y;
+ int x, x1, y __unused;
getyx(pads->status, y, x);

waddwstr(pads->status, wch);

0 comments on commit 9324aed

Please sign in to comment.