Bug 258471

Summary: emulators/elliott: fix build with clang 13
Product: Ports & Packages Reporter: Dimitry Andric <dim>
Component: Individual Port(s)Assignee: Dimitry Andric <dim>
Status: Closed FIXED    
Severity: Affects Some People CC: fernape
Priority: ---    
Version: Latest   
Hardware: Any   
OS: Any   
Bug Depends on:    
Bug Blocks: 258209    
Attachments:
Description Flags
emulators/elliott: fix unused but set variable none

Description Dimitry Andric freebsd_committer freebsd_triage 2021-09-13 07:59:21 UTC
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.
Comment 1 Dimitry Andric freebsd_committer freebsd_triage 2021-09-13 07:59:53 UTC
Created attachment 227867 [details]
emulators/elliott: fix unused but set variable
Comment 2 Fernando ApesteguĂ­a freebsd_committer freebsd_triage 2021-09-16 05:57:20 UTC
^Triage: Reporter is committer, assign accordingly.
Comment 3 commit-hook freebsd_committer freebsd_triage 2021-10-02 11:30:47 UTC
A commit in branch main references this bug:

URL: https://cgit.FreeBSD.org/ports/commit/?id=9324aed8ec1e8eded0cf24824d5fc8732a93155b

commit 9324aed8ec1e8eded0cf24824d5fc8732a93155b
Author:     Dimitry Andric <dim@FreeBSD.org>
AuthorDate: 2021-09-13 07:56:40 +0000
Commit:     Dimitry Andric <dim@FreeBSD.org>
CommitDate: 2021-10-02 11:24:44 +0000

    emulators/elliott: fix unused but set variable

    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

 emulators/elliott-803/files/patch-emulator_emulator.c (new) | 11 +++++++++++
 1 file changed, 11 insertions(+)