Stub clog causes unused variable errors if the variables are only used in logs

Open
#79 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
3/5
Estimated time
1-2 days
Newbie friendliness
35/100
Issue type
Bug
Clarity
Needs clarification
Activity status
Stale
Tech stack
cpp

Research direction

Start with the QuicTraceEventStubVarArgs definition and the QuicTraceEvent macro shown in the issue, then inspect how CLOG emits or uses this stub when logging is disabled. Verify the change with a compilation case where variables are referenced only through logging, and consider the work done when that case no longer produces unused-variable errors.

Written by the indexing model from the issue text.

Description

bug help wanted
inline
void
QuicTraceEventStubVarArgs(
    _In_ const void* Fmt,
    ...
    )
{
    UNREFERENCED_PARAMETER(Fmt);
}
#define QuicTraceEvent(Name, ...) QuicTraceEventStubVarArgs("", __VA_ARGS__)

In msquic, we use the following trick to make sure the compiler sees all logs as referenced, rather then just defining away the macro.

Dominant language
C#
Stars
36
Forks
15
Avg merge
1d 5m
Merged PRs (30d)
1

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from microsoft/CLOG

All issues in microsoft/CLOG

Similar issues

More C# issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.