Skip to content

PROTON-2715: remove unused for-cycle counter variable#395

Merged
jiridanek merged 1 commit intoapache:mainfrom
jiridanek:jd_2023_04_19_unused_variable_tracing_example
Apr 20, 2023
Merged

PROTON-2715: remove unused for-cycle counter variable#395
jiridanek merged 1 commit intoapache:mainfrom
jiridanek:jd_2023_04_19_unused_variable_tracing_example

Conversation

@jiridanek
Copy link
Contributor

Some for loops just silently scream to be let out as while

[ 83%] Building CXX object cpp/examples/CMakeFiles/tracing_server.dir/tracing_server.cpp.o
/home/jdanek/repos/qpid/qpid-proton/cpp/examples/flow_control.cpp:65:18: error: variable 'i' set but not used [-Werror,-Wunused-but-set-variable]
        for (int i = sequence; available && s.credit() > 0; i++) {
                 ^
1 error generated.

Some for loops just silently scream to be let out as while

```
[ 83%] Building CXX object cpp/examples/CMakeFiles/tracing_server.dir/tracing_server.cpp.o
/home/jdanek/repos/qpid/qpid-proton/cpp/examples/flow_control.cpp:65:18: error: variable 'i' set but not used [-Werror,-Wunused-but-set-variable]
        for (int i = sequence; available && s.credit() > 0; i++) {
                 ^
1 error generated.
```
@jiridanek jiridanek requested a review from astitcher April 19, 2023 14:51
Copy link
Member

@astitcher astitcher left a comment

Choose a reason for hiding this comment

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

Amazing the compiler stayed silent so long!

@jiridanek
Copy link
Contributor Author

Amazing the compiler stayed silent so long!

It's the power of switching to clang! Maybe Red Hat should consider doing that ;DDD

@jiridanek jiridanek changed the title PROTON-xxxx: remove unused for cycle counter variable PROTON-2715: remove unused for-cycle counter variable Apr 20, 2023
@jiridanek jiridanek merged commit e744d77 into apache:main Apr 20, 2023
@jiridanek jiridanek deleted the jd_2023_04_19_unused_variable_tracing_example branch April 20, 2023 14:24
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