Skip to content

main.cpp: unused-but-set-variable warnings for command line options with CONFIG+=serveronly #2574

@hoffie

Description

@hoffie

Describe the bug

When building with CONFIG+=serveronly, gcc 10.2.1 emits the following warnings:

src/main.cpp: In function 'int main(int, char**)':
src/main.cpp:83:18: warning: variable 'bShowComplRegConnList' set but not used [-Wunused-but-set-variable]
   83 |     bool         bShowComplRegConnList       = false;
      |                  ^~~~~~~~~~~~~~~~~~~~~
src/main.cpp:87:18: warning: variable 'bShowAnalyzerConsole' set but not used [-Wunused-but-set-variable]
   87 |     bool         bShowAnalyzerConsole        = false;
      |                  ^~~~~~~~~~~~~~~~~~~~
src/main.cpp:88:18: warning: variable 'bMuteStream' set but not used [-Wunused-but-set-variable]
   88 |     bool         bMuteStream                 = false;
      |                  ^~~~~~~~~~~
src/main.cpp:92:18: warning: variable 'bNoAutoJackConnect' set but not used [-Wunused-but-set-variable]
   92 |     bool         bNoAutoJackConnect          = false;
      |                  ^~~~~~~~~~~~~~~~~~

To Reproduce

qmake CONFIG+=serveronly && make

Expected behavior

No warnings.

  1. Those variables should either be used in the sense that we output an error/warning to the user if they are enabled despite not having an effect.
  2. Alternatively, support for those flags and variables could be #ifdef'd out.
  3. We could silence the warnings via Q_UNUSED(). I don't think we should do that.

Screenshots

Operating system

Debian 11

Version of Jamulus

master (a9deb22)

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions