Stub clog causes unused variable errors if the variables are only used in logs
Open
Nobody has claimed this yet.
bug
help wanted
- Dominant language
- C#
- Stars
- 36
- Forks
- 15
- Avg merge
- 1d 5m
- Merged PRs (30d)
- 1
Description
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.
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
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.
Assessment
- Tech stack
- cpp
- Domain
- observability, tooling
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 35/100