Skip to content

Fix some compiler warnings

Frediano Ziglio requested to merge fziglio/spice:mr_warning_odr into master

tests: Fix -Wodr warning compiling tests with LTO enabled

Avoid the compiler to see 2 different defines of the same structure.

Also removes:

In function ‘stream_channel_get_supported_codecs’,
    inlined from ‘on_connect’ at ../server/stream-channel.cpp:364:60:
../server/stream-channel.cpp:326:31: warning: writing 1 byte into a region of size 0 [-Wstringop-overflow=]
  326 |             out_codecs[num++] = codec;
      |                               ^
../server/stream-channel.cpp: In member function ‘on_connect’:
/usr/include/spice-1/spice/stream-device.h:209:13: note: destination object ‘codecs’ of size 0
  209 |     uint8_t codecs[0];
      |             ^

Reported by Tomasz Kłoczko in #44 (closed)

Edited by Frediano Ziglio

Merge request reports