overte icon indicating copy to clipboard operation
overte copied to clipboard

Warnings as errors

Open HifiExperiments opened this issue 1 year ago • 4 comments

Closes #930

this is currently against the protocol_changes branch because one of the errors is in AudioMixer.cpp (from a recent PR of mine). I've only tried this on windows so I need to see if this works on linux.

  • [x] before merging this I should merge master -> protocol_changes and verify it still works

Funding

This project is funded through NGI0 Entrust, a fund established by NLnet with financial support from the European Commission's Next Generation Internet program. Learn more at the NLnet project page.

NLnet foundation logo NGI Zero Logo

HifiExperiments avatar Apr 16 '24 21:04 HifiExperiments

this one's failing with some kind of cmake error, but my changes to cmake were very minor...

HifiExperiments avatar Apr 17 '24 20:04 HifiExperiments

this one's failing with some kind of cmake error, but my changes to cmake were very minor...

It's failing in glslang, it's possible the warnings as errors setting is being applied to a dependency that's building with warnings?

daleglass avatar Apr 17 '24 20:04 daleglass

ah that makes sense. should we pass a different set of flags to dependencies? or just only set this flag later?

HifiExperiments avatar Apr 17 '24 20:04 HifiExperiments

I think setting it later might work?

daleglass avatar Apr 17 '24 20:04 daleglass

okie dokie! just a few more errors:

Windows (fixed):

2025-01-14T01:12:04.9462247Z C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\VC\Tools\MSVC\14.29.30133\include\ostream(155,1): error C2220: the following warning is treated as an error (compiling source file D:\a\overte\overte\libraries\shared\src\StreamUtils.cpp) [D:\a\overte\overte\build\libraries\shared\shared.vcxproj]
2025-01-14T01:12:05.0693610Z C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\VC\Tools\MSVC\14.29.30133\include\ostream(154): message : while compiling class template member function 'void std::basic_ostream<char,std::char_traits<char>>::_Osfx(void)' (compiling source file D:\a\overte\overte\libraries\shared\src\StreamUtils.cpp) [D:\a\overte\overte\build\libraries\shared\shared.vcxproj]
2025-01-14T01:12:05.1363854Z C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\VC\Tools\MSVC\14.29.30133\include\ostream(118): message : see reference to function template instantiation 'void std::basic_ostream<char,std::char_traits<char>>::_Osfx(void)' being compiled (compiling source file D:\a\overte\overte\libraries\shared\src\StreamUtils.cpp) [D:\a\overte\overte\build\libraries\shared\shared.vcxproj]
2025-01-14T01:12:05.1534907Z C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\VC\Tools\MSVC\14.29.30133\include\ostream(640): message : see reference to class template instantiation 'std::basic_ostream<char,std::char_traits<char>>' being compiled (compiling source file D:\a\overte\overte\libraries\shared\src\StreamUtils.cpp) [D:\a\overte\overte\build\libraries\shared\shared.vcxproj]
2025-01-14T01:12:05.1850661Z C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\VC\Tools\MSVC\14.29.30133\include\ostream(155,1): warning C4530: C++ exception handler used, but unwind semantics are not enabled. Specify /EHsc (compiling source file D:\a\overte\overte\libraries\shared\src\StreamUtils.cpp) [D:\a\overte\overte\build\libraries\shared\shared.vcxproj]


2025-01-14T01:12:14.5853011Z C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\VC\Tools\MSVC\14.29.30133\include\vector(1296,1): error C2220: the following warning is treated as an error (compiling source file D:\a\overte\overte\libraries\shared\src\shared\Shapes.cpp) [D:\a\overte\overte\build\libraries\shared\shared.vcxproj]
2025-01-14T01:12:14.5858137Z C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\VC\Tools\MSVC\14.29.30133\include\vector(1286): message : while compiling class template member function 'void std::vector<geometry::Vec,std::allocator<geometry::Vec>>::_Reallocate_exactly(const unsigned __int64)' (compiling source file D:\a\overte\overte\libraries\shared\src\shared\Shapes.cpp) [D:\a\overte\overte\build\libraries\shared\shared.vcxproj]
2025-01-14T01:12:14.5865921Z C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\VC\Tools\MSVC\14.29.30133\include\vector(1363): message : see reference to function template instantiation 'void std::vector<geometry::Vec,std::allocator<geometry::Vec>>::_Reallocate_exactly(const unsigned __int64)' being compiled (compiling source file D:\a\overte\overte\libraries\shared\src\shared\Shapes.cpp) [D:\a\overte\overte\build\libraries\shared\shared.vcxproj]
2025-01-14T01:12:14.5874185Z D:\a\overte\overte\libraries\shared\src\shared\Shapes.h(36): message : see reference to class template instantiation 'std::vector<geometry::Vec,std::allocator<geometry::Vec>>' being compiled (compiling source file D:\a\overte\overte\libraries\shared\src\shared\Shapes.cpp) [D:\a\overte\overte\build\libraries\shared\shared.vcxproj]
2025-01-14T01:12:14.6131198Z D:\a\overte\overte\libraries\shared\src\shared\Shapes.h(61): message : see reference to class template instantiation 'geometry::Solid<N>' being compiled (compiling source file D:\a\overte\overte\libraries\shared\src\shared\Shapes.cpp) [D:\a\overte\overte\build\libraries\shared\shared.vcxproj]
2025-01-14T01:12:14.6140566Z C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\VC\Tools\MSVC\14.29.30133\include\vector(1296,1): warning C4530: C++ exception handler used, but unwind semantics are not enabled. Specify /EHsc (compiling source file D:\a\overte\overte\libraries\shared\src\shared\Shapes.cpp) [D:\a\overte\overte\build\libraries\shared\shared.vcxproj]

Ubuntu 20.04, amd64 (fixed):

In file included from /__w/overte/overte/libraries/networking/src/crash-handler/CrashHandlerBackend_Crashpad.cpp:37:
/__w/overte/overte/build/ext/makefiles/crashpad/project/src/crashpad/include/client/crashpad_info.h:223:18: error: multi-character character constant [-Werror=multichar]
  223 |     kSignature = 'CPad',

Ubuntu 22.04, aarch64 (fixed):

/__w/overte/overte/libraries/octree/src/OctreePacketData.cpp: In static member function 'static int OctreePacketData::unpackDataFromBytes(const unsigned char*, QSet<QString>&)':
/__w/overte/overte/libraries/octree/src/OctreePacketData.cpp:831:11: error: 'void* memcpy(void*, const void*, size_t)' writing to an object of type 'class QString' with no trivial copy-assignment; use copy-assignment or copy-initialization instead [-Werror=class-memaccess]
  831 |     memcpy(resultVector.data(), dataBytes, length * sizeof(QString));

I'm not sure about the Window's issues. The second one is an issue in crashpad. I'll take a look at the third one.

HifiExperiments avatar Jan 16 '25 05:01 HifiExperiments

(fixed) new windows error:

2025-01-18T05:48:06.6445109Z D:\a\overte\overte\libraries\networking\src\SockAddr.cpp(25,10): fatal error C1083: Cannot open include file: 'netinet/in.h': No such file or directory [D:\a\overte\overte\build\libraries\networking\networking.vcxproj]

offending lines:

#ifdef WIN32
#include <winsock2.h>
#include <WS2tcpip.h>
#else
#include <netinet/in.h>
#endif

HifiExperiments avatar Jan 18 '25 06:01 HifiExperiments

(fixed) new linux issue inside crashpad? I don't think anything changed about the paths...

In file included from /__w/overte/overte/build/ext/makefiles/crashpad/project/src/crashpad/include/client/annotation_list.h:21,
                 from /__w/overte/overte/build/ext/makefiles/crashpad/project/src/crashpad/include/client/crashpad_info.h:21,
                 from /__w/overte/overte/libraries/networking/src/crash-handler/CrashHandlerBackend_Crashpad.cpp:37:
/__w/overte/overte/build/ext/makefiles/crashpad/project/src/crashpad/include/client/annotation.h:30:10: fatal error: util/synchronization/scoped_spin_guard.h: No such file or directory
   30 | #include "util/synchronization/scoped_spin_guard.h"
      |          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

HifiExperiments avatar Jan 19 '25 07:01 HifiExperiments

on the server, an interesting one from tbb (fixed):

In member function 'store',
    inlined from 'store' at /usr/include/c++/12/atomic:104:20,
    inlined from 'abort_all_relaxed' at /github/home/overte-files/vcpkg/cd365c66-release/buildtrees/tbb/src/29ae22733f-af8f4edd65.clean/src/tbb/concurrent_monitor.h:431:53,
    inlined from 'abort_all' at /github/home/overte-files/vcpkg/cd365c66-release/buildtrees/tbb/src/29ae22733f-af8f4edd65.clean/src/tbb/concurrent_monitor.h:414:26,
    inlined from 'destroy' at /github/home/overte-files/vcpkg/cd365c66-release/buildtrees/tbb/src/29ae22733f-af8f4edd65.clean/src/tbb/concurrent_monitor.h:447:24,
    inlined from '__dt_base ' at /github/home/overte-files/vcpkg/cd365c66-release/buildtrees/tbb/src/29ae22733f-af8f4edd65.clean/src/tbb/market_concurrent_monitor.h:102:16,
    inlined from '__dt_base ' at /github/home/overte-files/vcpkg/cd365c66-release/buildtrees/tbb/src/29ae22733f-af8f4edd65.clean/src/tbb/market.h:55:7:
/usr/include/c++/12/bits/atomic_base.h:464:25: error: '__atomic_store_1' writing 1 byte into a region of size 0 overflows the destination [-Werror=stringop-overflow=]
  464 |         __atomic_store_n(&_M_i, __i, int(__m));

for this one we might just have to add -Wno-error=stringop-overflow?

HifiExperiments avatar Jan 19 '25 20:01 HifiExperiments

success!! this is ready for testing and review

HifiExperiments avatar Jan 21 '25 00:01 HifiExperiments

Surprisingly I tested Interface from this version and it does seem to work on regular servers, but indeed if there's change in protocol it's best to target it to protocol_changes.

ksuprynowicz avatar Jan 22 '25 18:01 ksuprynowicz

yeah, the problem only affects tags, which no one is using

I’ll retarget this, since I’m working on some other protocol changes, hopefully it won’t be too long before we can merge back to master

HifiExperiments avatar Jan 22 '25 19:01 HifiExperiments

retargeted to protocol_changes!

this is ready to merge from my end if it looks good to everyone!

HifiExperiments avatar Jan 23 '25 07:01 HifiExperiments