Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

variable 'nremoved' set but not used warnings when compile master using clang-14 #2242

Closed
thorneliu opened this issue May 11, 2023 · 0 comments

Comments

@thorneliu
Copy link
Contributor

Describe the bug (描述bug)

/Users/apple/Documents/brpc/src/bvar/detail/sampler.cpp:163:13: warning: variable 'nremoved' set but not used [-Wunused-but-set-variable]
        int nremoved = 0;
            ^
/Users/apple/Documents/brpc/src/bvar/detail/sampler.cpp:164:13: warning: variable 'nsampled' set but not used [-Wunused-but-set-variable]
        int nsampled = 0;
/Users/apple/Documents/brpc/src/brpc/details/hpack.cpp:492:12: warning: variable 'out_bytes' set but not used [-Wunused-but-set-variable]
    size_t out_bytes = 1;
Users/apple/Documents/brpc/src/brpc/span.cpp:752:17: warning: variable 'i' set but not used [-Wunused-but-set-variable]
    for (size_t i = 0; nscan < max_scan && it->Valid(); ++i, it->Prev()) {
                ^

To Reproduce (复现方法)
compile

mkdir build
cd build
cmake ../
make -j3

Expected behavior (期望行为)
No warnings

Versions (各种版本)
OS: MacOS Ventura 13.3.1
Apple clang version 14.0.3 (clang-1403.0.22.14.1)
Target: x86_64-apple-darwin22.4.0
Thread model: posix
InstalledDir: /Library/Developer/CommandLineTools/usr/binCompiler:

brpc:
5cc470b

protobuf:
3.31.12

Additional context/screenshots (更多上下文/截图)

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

No branches or pull requests

2 participants