Skip to content

Silence some compiler warnings#13

Open
developer79433 wants to merge 3 commits intoOpenThingsIO:masterfrom
developer79433:silence-warnings
Open

Silence some compiler warnings#13
developer79433 wants to merge 3 commits intoOpenThingsIO:masterfrom
developer79433:silence-warnings

Conversation

@developer79433
Copy link

No description provided.

external/OpenThings-Framework-Firmware-Library/LinuxLocalServer.cpp: In destructor ‘OTF::LinuxLocalServer::~LinuxLocalServer()’:
external/OpenThings-Framework-Firmware-Library/LinuxLocalServer.cpp:9:3: warning: this ‘if’ clause does not guard... [-Wmisleading-indentation]
    9 |   if (activeClient != nullptr)
      |   ^~
external/OpenThings-Framework-Firmware-Library/LinuxLocalServer.cpp:11:5: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the ‘if’
   11 |     delete activeClient;
      |     ^~~~~~
Silences several warnings, eg:

external/OpenThings-Framework-Firmware-Library/LinuxLocalServer.cpp:11:5: warning: deleting object of polymorphic class type ‘OTF::LinuxLocalClient’ which has non-virtual destructor might cause undefined behavior [-Wdelete-non-virtual-dtor]
   11 |     delete activeClient;
      |     ^~~~~~~~~~~~~~~~~~~
Silences (eg when building OpenSprinkler):

external/OpenThings-Framework-Firmware-Library/OpenThingsFramework.cpp: In member function ‘void OTF::OpenThingsFramework::localServerLoop()’:
external/OpenThings-Framework-Firmware-Library/OpenThingsFramework.cpp:126:16: warning: comparison of integer expressions of different signedness: ‘size_t’ {aka ‘long unsigned int’} and ‘int’ [-Wsign-compare]
  126 |     if (length >= headerBufferSize) {
      |         ~~~~~~~^~~~~~~~~~~~~~~~~~~
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant