From 0e78f68ceb5426984f761355dccd74a9dd4e74b0 Mon Sep 17 00:00:00 2001 From: Bhagirath Mehta Date: Wed, 10 Jun 2026 12:39:13 -0500 Subject: [PATCH 1/5] Fix -Wextra-semi errors in LogManagerBase.hpp public header Downstream consumers that compile the public headers with -Wextra-semi -Werror (issue #1335) fail to build because several member definitions carry a redundant trailing ';': - the LogManagerBase ctor/copy-ctor/assignment/dtor written as `(){};` - every delegating method whose entire body is an LM_SAFE_CALL* macro (the macro already expands to a `{ ... }` block, so the ';' after the invocation is an extra ';' after a member function definition). Drop the redundant ';' in those 28 spots. Statement-level LM_SAFE_CALL uses inside braced bodies are intentionally left as-is, since -Wextra-semi does not flag those. No functional change. The SDK's own build uses -Wall -Werror -Wextra but not -Wextra-semi, so this never surfaced in CI. Fixes #1335. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- lib/include/public/LogManagerBase.hpp | 56 +++++++++++++-------------- 1 file changed, 28 insertions(+), 28 deletions(-) diff --git a/lib/include/public/LogManagerBase.hpp b/lib/include/public/LogManagerBase.hpp index 838002b93..b9ffdefca 100644 --- a/lib/include/public/LogManagerBase.hpp +++ b/lib/include/public/LogManagerBase.hpp @@ -132,22 +132,22 @@ namespace MAT_NS_BEGIN /// /// LogManagerBase constructor /// - LogManagerBase(){}; + LogManagerBase(){} /// /// LogManager copy constructor /// - LogManagerBase(const LogManagerBase&){}; + LogManagerBase(const LogManagerBase&){} /// /// [not implemented] LogManager assignment operator /// - LogManagerBase& operator=(const LogManagerBase&){}; + LogManagerBase& operator=(const LogManagerBase&){} /// /// LogManager destructor /// - virtual ~LogManagerBase(){}; + virtual ~LogManagerBase(){} #ifndef _MANAGED /// @@ -418,7 +418,7 @@ namespace MAT_NS_BEGIN /// Get profile name based on built-in profile enum /// Transmit profile static std::string GetTransmitProfileName() - LM_SAFE_CALL_STR(GetTransmitProfileName); + LM_SAFE_CALL_STR(GetTransmitProfileName) /// /// Retrieve an ISemanticContext interface through which to specify context information @@ -428,7 +428,7 @@ namespace MAT_NS_BEGIN /// /// ISemanticContext interface pointer static ISemanticContext* GetSemanticContext() - LM_SAFE_CALL_PTRREF(GetSemanticContext); + LM_SAFE_CALL_PTRREF(GetSemanticContext) /// /// Adds or overrides a property of the custom context for the telemetry logging system. @@ -439,7 +439,7 @@ namespace MAT_NS_BEGIN /// Value of the context property /// PIIKind of the context with PiiKind_None as the default static status_t SetContext(const std::string& name, const std::string& value, PiiKind piiKind = PiiKind_None) - LM_SAFE_CALL(SetContext, name, value, piiKind); + LM_SAFE_CALL(SetContext, name, value, piiKind) /// /// Adds or overrides a property of the custom context for the telemetry logging system. @@ -450,7 +450,7 @@ namespace MAT_NS_BEGIN /// Value of the context property /// PIIKind of the context with PiiKind_None as the default static status_t SetContext(const std::string& name, const char* value, PiiKind piiKind = PiiKind_None) - LM_SAFE_CALL(SetContext, name, std::string(value), piiKind); + LM_SAFE_CALL(SetContext, name, std::string(value), piiKind) /// /// Adds or overrides a property of the global context. @@ -458,7 +458,7 @@ namespace MAT_NS_BEGIN /// Name of the property /// Double value of the property static status_t SetContext(const std::string& name, double value, PiiKind piiKind = PiiKind_None) - LM_SAFE_CALL(SetContext, name, value, piiKind); + LM_SAFE_CALL(SetContext, name, value, piiKind) /// /// Adds or overrides a property of the global context. @@ -466,7 +466,7 @@ namespace MAT_NS_BEGIN /// Name of the property /// 64-bit Integer value of the property static status_t SetContext(const std::string& name, int64_t value, PiiKind piiKind = PiiKind_None) - LM_SAFE_CALL(SetContext, name, value, piiKind); + LM_SAFE_CALL(SetContext, name, value, piiKind) /// /// Adds or overrides a property of the global context.
@@ -475,7 +475,7 @@ namespace MAT_NS_BEGIN /// Name of the property /// 8-bit Integer value of the property static status_t SetContext(const std::string& name, int8_t value, PiiKind piiKind = PiiKind_None) - LM_SAFE_CALL(SetContext, name, (int64_t)value, piiKind); + LM_SAFE_CALL(SetContext, name, (int64_t)value, piiKind) /// /// Adds or overrides a property of the global context.
@@ -484,7 +484,7 @@ namespace MAT_NS_BEGIN /// Name of the property /// 16-bit Integer value of the property static status_t SetContext(const std::string& name, int16_t value, PiiKind piiKind = PiiKind_None) - LM_SAFE_CALL(SetContext, name, (int64_t)value, piiKind); + LM_SAFE_CALL(SetContext, name, (int64_t)value, piiKind) /// /// Adds or overrides a property of the global context.
@@ -493,7 +493,7 @@ namespace MAT_NS_BEGIN /// Name of the property /// 32-bit Integer value of the property static status_t SetContext(const std::string& name, int32_t value, PiiKind piiKind = PiiKind_None) - LM_SAFE_CALL(SetContext, name, (int64_t)value, piiKind); + LM_SAFE_CALL(SetContext, name, (int64_t)value, piiKind) /// /// Adds or overrides a property of the global context.
@@ -502,7 +502,7 @@ namespace MAT_NS_BEGIN /// Name of the property /// 8-bit unsigned integer value of the property static status_t SetContext(const std::string& name, uint8_t value, PiiKind piiKind = PiiKind_None) - LM_SAFE_CALL(SetContext, name, (int64_t)value, piiKind); + LM_SAFE_CALL(SetContext, name, (int64_t)value, piiKind) /// /// Adds or overrides a property of the global context.
@@ -511,7 +511,7 @@ namespace MAT_NS_BEGIN /// Name of the property /// 16-bit unsigned integer value of the property static status_t SetContext(const std::string& name, uint16_t value, PiiKind piiKind = PiiKind_None) - LM_SAFE_CALL(SetContext, name, (int64_t)value, piiKind); + LM_SAFE_CALL(SetContext, name, (int64_t)value, piiKind) /// /// Adds or overrides a property of the global context.
@@ -520,7 +520,7 @@ namespace MAT_NS_BEGIN /// Name of the property /// 32-bit unsigned integer value of the property static status_t SetContext(const std::string& name, uint32_t value, PiiKind piiKind = PiiKind_None) - LM_SAFE_CALL(SetContext, name, (int64_t)value, piiKind); + LM_SAFE_CALL(SetContext, name, (int64_t)value, piiKind) /// /// Adds or overrides a property of the global context.
@@ -529,7 +529,7 @@ namespace MAT_NS_BEGIN /// Name of the property /// 64-bit unsigned integer value of the property static status_t SetContext(const std::string& name, uint64_t value, PiiKind piiKind = PiiKind_None) - LM_SAFE_CALL(SetContext, name, (int64_t)value, piiKind); + LM_SAFE_CALL(SetContext, name, (int64_t)value, piiKind) /// /// Adds or overrides a property of the global context. @@ -537,7 +537,7 @@ namespace MAT_NS_BEGIN /// Name of the property /// Boolean value of the property static status_t SetContext(const std::string& name, bool value, PiiKind piiKind = PiiKind_None) - LM_SAFE_CALL(SetContext, name, value, piiKind); + LM_SAFE_CALL(SetContext, name, value, piiKind) /// /// Adds or overrides a property of the global context. @@ -545,7 +545,7 @@ namespace MAT_NS_BEGIN /// Name of the property /// .NET time ticks static status_t SetContext(const std::string& name, time_ticks_t value, PiiKind piiKind = PiiKind_None) - LM_SAFE_CALL(SetContext, name, value, piiKind); + LM_SAFE_CALL(SetContext, name, value, piiKind) /// /// Adds or overrides a property of the global context. @@ -553,14 +553,14 @@ namespace MAT_NS_BEGIN /// Name of the property /// GUID static status_t SetContext(const std::string& name, GUID_t value, PiiKind piiKind = PiiKind_None) - LM_SAFE_CALL(SetContext, name, value, piiKind); + LM_SAFE_CALL(SetContext, name, value, piiKind) /// /// Retrieves the ILogger interface of a Logger instance through which to log telemetry event. /// /// Pointer to the Ilogger interface of an logger instance static ILogger* GetLogger() - LM_SAFE_CALL_PTR(GetLogger, GetPrimaryToken()); + LM_SAFE_CALL_PTR(GetLogger, GetPrimaryToken()) /// /// Retrieves the ILogger interface of a Logger instance through which to log telemetry event. @@ -568,7 +568,7 @@ namespace MAT_NS_BEGIN /// Source name of events sent by this logger instance /// Pointer to the Ilogger interface of the logger instance static ILogger* GetLogger(const std::string& source) - LM_SAFE_CALL_PTR(GetLogger, GetPrimaryToken(), source); + LM_SAFE_CALL_PTR(GetLogger, GetPrimaryToken(), source) /// /// Retrieves the ILogger interface of a Logger instance through which to log telemetry event. @@ -577,13 +577,13 @@ namespace MAT_NS_BEGIN /// Source name of events sent by this logger instance /// Pointer to the Ilogger interface of the logger instance static ILogger* GetLogger(const std::string& tenantToken, const std::string& source) - LM_SAFE_CALL_PTR(GetLogger, tenantToken, source); + LM_SAFE_CALL_PTR(GetLogger, tenantToken, source) /// /// Get Auth token controller /// static IAuthTokensController* GetAuthTokensController() - LM_SAFE_CALL_PTR(GetAuthTokensController); + LM_SAFE_CALL_PTR(GetAuthTokensController) /// ///Sets the ticket token with a value @@ -653,7 +653,7 @@ namespace MAT_NS_BEGIN /// /// The log session data in a pointer to a LogSessionData object. static LogSessionData* GetLogSessionData() - LM_SAFE_CALL_PTR(GetLogSessionData); + LM_SAFE_CALL_PTR(GetLogSessionData) /// /// Sets the diagnostic level filter for the LogManager @@ -662,7 +662,7 @@ namespace MAT_NS_BEGIN /// Minimum level to be sent /// Maximum level to be sent static void SetLevelFilter(uint8_t defaultLevel, uint8_t levelMin, uint8_t levelMax) - LM_SAFE_CALL_VOID(SetLevelFilter, defaultLevel, levelMin, levelMax); + LM_SAFE_CALL_VOID(SetLevelFilter, defaultLevel, levelMin, levelMax) /// /// Sets the diagnostic level filter for the LogManager @@ -670,7 +670,7 @@ namespace MAT_NS_BEGIN /// Diagnostic level for the LogManager /// Set with levels that are allowed to be sent static void SetLevelFilter(uint8_t defaultLevel, const std::set& allowedLevels) - LM_SAFE_CALL_VOID(SetLevelFilter, defaultLevel, allowedLevels); + LM_SAFE_CALL_VOID(SetLevelFilter, defaultLevel, allowedLevels) static ILogController* GetController() { @@ -686,7 +686,7 @@ namespace MAT_NS_BEGIN /// Reserved for future use to notify SDK about ILogConfiguration & contents change. /// static status_t Configure() - LM_SAFE_CALL(Configure); + LM_SAFE_CALL(Configure) /// /// Obtain data viewer collection associated with this LogManager instance. From 9ad125f0a33d3a82170117e662e113e1188f59f2 Mon Sep 17 00:00:00 2001 From: Bhagirath Mehta Date: Wed, 10 Jun 2026 13:55:30 -0500 Subject: [PATCH 2/5] LogManagerBase: address Copilot round-1 - delete copy operations operator= empty body / no return (LogManagerBase.hpp:145): the copy constructor and assignment operator were declared with empty bodies (the old "[not implemented]" non-copyable idiom). Copilot flagged that operator= returns LogManagerBase& with no return statement (UB if the template is instantiated and it is ever called). Convert both copy operations to = delete - the modern non-copyable idiom that Copilot recommended. The class is a static singleton utility base; verified neither the copy ctor nor operator= is referenced anywhere in lib/ or examples/. Validated the pattern compiles clean under -Wall -Wextra -Wextra-semi -Werror. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- lib/include/public/LogManagerBase.hpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/include/public/LogManagerBase.hpp b/lib/include/public/LogManagerBase.hpp index b9ffdefca..1de3b2a1f 100644 --- a/lib/include/public/LogManagerBase.hpp +++ b/lib/include/public/LogManagerBase.hpp @@ -137,12 +137,12 @@ namespace MAT_NS_BEGIN /// /// LogManager copy constructor /// - LogManagerBase(const LogManagerBase&){} + LogManagerBase(const LogManagerBase&) = delete; /// /// [not implemented] LogManager assignment operator /// - LogManagerBase& operator=(const LogManagerBase&){} + LogManagerBase& operator=(const LogManagerBase&) = delete; /// /// LogManager destructor From 99b0e0f69ea01eabcb191802a7f76a974e15e14a Mon Sep 17 00:00:00 2001 From: Bhagirath Mehta Date: Wed, 10 Jun 2026 14:12:00 -0500 Subject: [PATCH 3/5] LogManagerBase: address Copilot round-2 - well-formed no-op copy ops Round-1 used = delete; Copilot noted that changes copy/assignment semantics in a public header (vs this PR's no-functional-change intent) and left the doc comments stale. Per Copilot's own suggestion, keep the members defined and make operator= a well-formed no-op (return *this) - this fixes the original non-returning operator= UB without altering copy semantics. Dropped the now-inaccurate "[not implemented]" comment. Validated clean under -Wall -Wextra -Wextra-semi -Werror. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- lib/include/public/LogManagerBase.hpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/include/public/LogManagerBase.hpp b/lib/include/public/LogManagerBase.hpp index 1de3b2a1f..2dbc375f6 100644 --- a/lib/include/public/LogManagerBase.hpp +++ b/lib/include/public/LogManagerBase.hpp @@ -137,12 +137,12 @@ namespace MAT_NS_BEGIN /// /// LogManager copy constructor /// - LogManagerBase(const LogManagerBase&) = delete; + LogManagerBase(const LogManagerBase&){} /// - /// [not implemented] LogManager assignment operator + /// LogManager assignment operator /// - LogManagerBase& operator=(const LogManagerBase&) = delete; + LogManagerBase& operator=(const LogManagerBase&){ return *this; } /// /// LogManager destructor From 53d0a8700244db3d29fa731fe46819e9eb9fb1e1 Mon Sep 17 00:00:00 2001 From: Bhagirath Mehta Date: Wed, 10 Jun 2026 14:24:53 -0500 Subject: [PATCH 4/5] LogManagerBase: address Copilot round-3 - make non-copyable explicit (= delete) Converged on the explicit non-copyable design: delete the copy constructor and copy-assignment operator (the modern idiom, recommended in the original review). This definitively fixes the pre-existing non-returning operator= UB and removes the empty-stub ambiguity. Updated the doc comments to state the members are deleted / the class is non-copyable. Validated clean under -Wall -Wextra -Wextra-semi -Werror. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- lib/include/public/LogManagerBase.hpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/include/public/LogManagerBase.hpp b/lib/include/public/LogManagerBase.hpp index 2dbc375f6..addb61c36 100644 --- a/lib/include/public/LogManagerBase.hpp +++ b/lib/include/public/LogManagerBase.hpp @@ -135,14 +135,14 @@ namespace MAT_NS_BEGIN LogManagerBase(){} /// - /// LogManager copy constructor + /// LogManager copy constructor (deleted; LogManagerBase is non-copyable) /// - LogManagerBase(const LogManagerBase&){} + LogManagerBase(const LogManagerBase&) = delete; /// - /// LogManager assignment operator + /// LogManager assignment operator (deleted; LogManagerBase is non-copyable) /// - LogManagerBase& operator=(const LogManagerBase&){ return *this; } + LogManagerBase& operator=(const LogManagerBase&) = delete; /// /// LogManager destructor From 93fd52a0d1a7f5fe3b7fec8cfaaeea809cba45ca Mon Sep 17 00:00:00 2001 From: Bhagirath Mehta Date: Wed, 10 Jun 2026 14:38:52 -0500 Subject: [PATCH 5/5] LogManagerBase: address Copilot round-4 - scope to -Wextra-semi only The copy-operation body (= delete vs no-op vs empty stub) drew contradictory review feedback across rounds. Per the reviewer's "keep the PR purely about removing extra semicolons" option, revert the copy constructor and operator= to their original empty bodies and original doc comments, so this PR makes NO change to copy/assignment semantics or the public API surface - it only removes the redundant trailing ';'. The pre-existing empty-body operator= is left as-is (out of scope). Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- lib/include/public/LogManagerBase.hpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/include/public/LogManagerBase.hpp b/lib/include/public/LogManagerBase.hpp index addb61c36..b9ffdefca 100644 --- a/lib/include/public/LogManagerBase.hpp +++ b/lib/include/public/LogManagerBase.hpp @@ -135,14 +135,14 @@ namespace MAT_NS_BEGIN LogManagerBase(){} /// - /// LogManager copy constructor (deleted; LogManagerBase is non-copyable) + /// LogManager copy constructor /// - LogManagerBase(const LogManagerBase&) = delete; + LogManagerBase(const LogManagerBase&){} /// - /// LogManager assignment operator (deleted; LogManagerBase is non-copyable) + /// [not implemented] LogManager assignment operator /// - LogManagerBase& operator=(const LogManagerBase&) = delete; + LogManagerBase& operator=(const LogManagerBase&){} /// /// LogManager destructor