Skip to content

fix: replace NULL with nullptr in fake_notificationconsumer constructors#4686

Open
xq9mend wants to merge 1 commit into
sonic-net:masterfrom
xq9mend:fix/fake-notificationconsumer-nullptr
Open

fix: replace NULL with nullptr in fake_notificationconsumer constructors#4686
xq9mend wants to merge 1 commit into
sonic-net:masterfrom
xq9mend:fix/fake-notificationconsumer-nullptr

Conversation

@xq9mend

@xq9mend xq9mend commented Jun 19, 2026

Copy link
Copy Markdown
Contributor

Why

NULL is an integer literal (0) which is ambiguous when the member type is std::unique_ptr — the compiler cannot choose between unique_ptr(nullptr_t) and unique_ptr(pointer) overloads.

This is a forward-compatibility fix for sonic-swss-common#1212, which changes m_subscribe from a raw DBConnector* to std::unique_ptr<DBConnector>. Without this change, BuildSwss fails with:

fake_notificationconsumer.cpp:8:64: error: call of overloaded unique_ptr(NULL) is ambiguous

What

Replace m_subscribe(NULL) with m_subscribe(nullptr) in both constructors in fake_notificationconsumer.cpp.

nullptr has type std::nullptr_t and is unambiguous for both raw pointer and unique_ptr, making this change safe to merge independently before or after sonic-swss-common#1212.

How to verify

BuildSwss CI passes.

@xq9mend
xq9mend requested a review from prsunny as a code owner June 19, 2026 22:10
@mssonicbld

Copy link
Copy Markdown
Collaborator

/azp run

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines successfully started running 1 pipeline(s).

@xq9mend
xq9mend force-pushed the fix/fake-notificationconsumer-nullptr branch from 2747810 to 91192c0 Compare June 19, 2026 23:26
@mssonicbld

Copy link
Copy Markdown
Collaborator

/azp run

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines successfully started running 1 pipeline(s).

@xq9mend
xq9mend force-pushed the fix/fake-notificationconsumer-nullptr branch from 91192c0 to e68a01c Compare June 20, 2026 07:04
@xq9mend

xq9mend commented Jun 20, 2026

Copy link
Copy Markdown
Contributor Author

/azpw run Azure.sonic-swss

@mssonicbld

Copy link
Copy Markdown
Collaborator

⚠️ Notice: /azpw run only runs failed jobs now. If you want to trigger a whole pipline run, please rebase your branch or close and reopen the PR.
💡 Tip: You can also use /azpw retry to retry failed jobs directly.

Retrying failed(or canceled) jobs...

@mssonicbld

Copy link
Copy Markdown
Collaborator

No Azure DevOps builds found for #4686.

@mssonicbld

Copy link
Copy Markdown
Collaborator

/azp run

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines successfully started running 1 pipeline(s).

@xq9mend

xq9mend commented Jun 20, 2026

Copy link
Copy Markdown
Contributor Author

/azpw run Azure.sonic-swss

@mssonicbld

Copy link
Copy Markdown
Collaborator

⚠️ Notice: /azpw run only runs failed jobs now. If you want to trigger a whole pipline run, please rebase your branch or close and reopen the PR.
💡 Tip: You can also use /azpw retry to retry failed jobs directly.

Retrying failed(or canceled) jobs...

@mssonicbld

Copy link
Copy Markdown
Collaborator

Retrying failed(or canceled) stages in build 1144009:

✅Stage Test:

  • Job vstest: retried.

@xq9mend

xq9mend commented Jun 21, 2026

Copy link
Copy Markdown
Contributor Author

/azpw run Azure.sonic-swss

@mssonicbld

Copy link
Copy Markdown
Collaborator

⚠️ Notice: /azpw run only runs failed jobs now. If you want to trigger a whole pipline run, please rebase your branch or close and reopen the PR.
💡 Tip: You can also use /azpw retry to retry failed jobs directly.

Retrying failed(or canceled) jobs...

@mssonicbld

Copy link
Copy Markdown
Collaborator

Retrying failed(or canceled) stages in build 1144009:

✅Stage Test:

  • Job vstest: retried.

@xq9mend
xq9mend force-pushed the fix/fake-notificationconsumer-nullptr branch from e68a01c to 41fb8e3 Compare June 21, 2026 13:41
@mssonicbld

Copy link
Copy Markdown
Collaborator

/azp run

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines successfully started running 1 pipeline(s).

@xq9mend

xq9mend commented Jun 21, 2026

Copy link
Copy Markdown
Contributor Author

/azpw run Azure.sonic-swss

@mssonicbld

Copy link
Copy Markdown
Collaborator

⚠️ Notice: /azpw run only runs failed jobs now. If you want to trigger a whole pipline run, please rebase your branch or close and reopen the PR.
💡 Tip: You can also use /azpw retry to retry failed jobs directly.

Retrying failed(or canceled) jobs...

@mssonicbld

Copy link
Copy Markdown
Collaborator

Retrying failed(or canceled) stages in build 1144964:

✅Stage BuildTrixie:

  • Job arm64: retried.

✅Stage Test:

  • Job vstest: retried.

✅Stage BuildAsan:

NULL is an integer literal (0) which is ambiguous when the member type
is std::unique_ptr (introduced in sonic-swss-common PR sonic-net#1212). nullptr
has type std::nullptr_t and is unambiguous for both raw pointer and
unique_ptr, making this change forward-compatible.

Signed-off-by: xq9mend <xq9mend@users.noreply.github.com>
@xq9mend
xq9mend force-pushed the fix/fake-notificationconsumer-nullptr branch from 41fb8e3 to 446b4ed Compare June 22, 2026 07:41
@mssonicbld

Copy link
Copy Markdown
Collaborator

/azp run

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines successfully started running 1 pipeline(s).

@xq9mend

xq9mend commented Jun 22, 2026

Copy link
Copy Markdown
Contributor Author

Friendly ping — all build checks are passing (amd64, arm64, armhf, trixie, asan, docker). The Test vstest failure is a known p4rt infrastructure issue currently affecting all sonic-swss and sonic-swss-common PRs (test/VS image version skew), not related to this change. This PR is a 2-line fix. #4680 was merged recently under the same vstest failure condition. Ready for review and merge when you get a chance.

@mssonicbld

Copy link
Copy Markdown
Collaborator

/azp run

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines successfully started running 1 pipeline(s).

@xq9mend

xq9mend commented Jun 26, 2026

Copy link
Copy Markdown
Contributor Author

Pinging again on this — the Test vstest failure is a systemic sonic-net CI infrastructure issue affecting all sonic-swss and sonic-swss-common PRs since approximately June 8 (p4rt test suite / VS image version skew). It is not caused by this 2-line change.

All 14 build checks pass: amd64, arm64, armhf, trixie, asan, docker, BuildAsan. #4680 was merged with the same vstest failure as precedent.

This PR is blocking a chain of 4 sonic-swss-common PRs (#1211, #1212, #1213, #1214). Would appreciate a merge bypass when you get a chance. Thanks!

@prsunny
prsunny requested a review from mint570 June 30, 2026 22:55
@xq9mend

xq9mend commented Jul 21, 2026

Copy link
Copy Markdown
Contributor Author

/azp run Azure.sonic-swss

@azure-pipelines

Copy link
Copy Markdown
Commenter does not have sufficient privileges for PR 4686 in repo sonic-net/sonic-swss

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.

2 participants