From 789f5723321eda340632eaa3cd213d87b3f8b356 Mon Sep 17 00:00:00 2001 From: mwl4 Date: Wed, 25 Jan 2023 15:08:51 +0100 Subject: [PATCH 1/2] Fix compilation on linux: use abort() instead of assert( false ). assert() in release configuration resolves to empty code, while abort() is marked as [[noreturn]] and always is available. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit gcc error: error: ‘type’ may be used uninitialized in this function [-Werror=maybe-uninitialized]: public/tracy/../client/../common/TracyAlign.hpp: In function ‘void tracy::SysTraceWorker(void*)’: public/tracy/../client/../common/TracyAlign.hpp:22:11: error: ‘type’ may be used uninitialized in this function [-Werror=maybe-uninitialized] memcpy( ptr, &val, sizeof( T ) ); ~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~ In file included from public/TracyClient.cpp:26, from X.cpp: public/client/TracySysTrace.cpp:1258:35: note: ‘type’ was declared here QueueType type; ^~~~ --- public/client/TracySysTrace.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/public/client/TracySysTrace.cpp b/public/client/TracySysTrace.cpp index 9211bc8e..4a562eaa 100644 --- a/public/client/TracySysTrace.cpp +++ b/public/client/TracySysTrace.cpp @@ -1265,8 +1265,7 @@ void SysTraceWorker( void* ptr ) type = QueueType::HwSampleBranchMiss; break; default: - assert( false ); - break; + abort(); } TracyLfqPrepare( type ); From 1439e93a698c02c4ea13a141ffd9a1798a455ff9 Mon Sep 17 00:00:00 2001 From: mwl4 Date: Wed, 25 Jan 2023 15:11:49 +0100 Subject: [PATCH 2/2] Fix compilation on linux: always initialize ScopedZone::m_connectionId to 0. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit gcc error: public/tracy/../client/TracyScoped.hpp:102:9: error: ‘___tracy_scoped_zone.tracy::ScopedZone::m_connectionId’ may be used uninitialized in this function [-Werror=maybe-uninitialized] if( GetProfiler().ConnectionId() != m_connectionId ) return; ^~ --- public/client/TracyScoped.hpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/public/client/TracyScoped.hpp b/public/client/TracyScoped.hpp index 55859107..bc130791 100644 --- a/public/client/TracyScoped.hpp +++ b/public/client/TracyScoped.hpp @@ -166,7 +166,7 @@ private: const bool m_active; #ifdef TRACY_ON_DEMAND - uint64_t m_connectionId; + uint64_t m_connectionId = 0; #endif };