Skip to content

Fix -Wextra-semi errors in LogManagerBase.hpp#1471

Merged
bmehta001 merged 6 commits into
microsoft:mainfrom
bmehta001:bhamehta/logmanagerbase-extra-semi
Jun 10, 2026
Merged

Fix -Wextra-semi errors in LogManagerBase.hpp#1471
bmehta001 merged 6 commits into
microsoft:mainfrom
bmehta001:bhamehta/logmanagerbase-extra-semi

Conversation

@bmehta001

@bmehta001 bmehta001 commented Jun 10, 2026

Copy link
Copy Markdown
Contributor

Summary

Remove unnecessary semicolons that could cause errors with strict compilation settings.

Downstream consumers that compile the public headers with
-Wextra-semi -Werror (issue microsoft#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 microsoft#1335.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@bmehta001 bmehta001 requested a review from a team as a code owner June 10, 2026 17:39
@bmehta001 bmehta001 requested a review from Copilot June 10, 2026 18:47
@bmehta001 bmehta001 self-assigned this Jun 10, 2026

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR updates the public LogManagerBase.hpp header to compile cleanly under Clang’s -Wextra-semi -Werror by removing redundant trailing semicolons after inline member function definitions (including functions whose entire body is provided via LM_SAFE_CALL* macros).

Changes:

  • Removed extra ; after the LogManagerBase ctor/copy-ctor/assignment-operator/dtor inline definitions.
  • Removed extra ; after macro-bodied inline member function definitions where the LM_SAFE_CALL* macro expands to a { ... } function body.
  • Kept statement-level LM_SAFE_CALL* uses inside normal braced function bodies unchanged to avoid churn.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread lib/include/public/LogManagerBase.hpp
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>

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 1 out of 1 changed files in this pull request and generated 3 comments.

Comment thread lib/include/public/LogManagerBase.hpp Outdated
Comment thread lib/include/public/LogManagerBase.hpp Outdated
Comment thread lib/include/public/LogManagerBase.hpp Outdated
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>

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 1 out of 1 changed files in this pull request and generated 1 comment.

Comment thread lib/include/public/LogManagerBase.hpp Outdated
…(= 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>

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 1 out of 1 changed files in this pull request and generated 1 comment.

Comment thread lib/include/public/LogManagerBase.hpp Outdated
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>

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 1 out of 1 changed files in this pull request and generated no new comments.

@bmehta001 bmehta001 merged commit 6a7e6d4 into microsoft:main Jun 10, 2026
32 checks passed
@bmehta001 bmehta001 deleted the bhamehta/logmanagerbase-extra-semi branch June 10, 2026 23:08
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.

3 participants