portable: Add const to local vars to suppress CPPCHECK warning#20368
Conversation
🔗 Helpful Links🧪 See artifacts and rendered test results at hud.pytorch.org/pr/pytorch/executorch/20368
Note: Links to docs will display an error until the docs builds have been completed. ❌ 6 New Failures, 1 Cancelled Job, 3 Unrelated Failures, 1 Unclassified FailureAs of commit 39aa25c with merge base 574bfca ( NEW FAILURES - The following jobs have failed:
UNCLASSIFIED FAILURE - DrCI could not classify the following job because the workflow did not run on the merge base. The failure may be pre-existing on trunk or introduced by this PR:
CANCELLED JOB - The following job was cancelled. Please retry:
FLAKY - The following job failed but was likely due to flakiness present on trunk:
BROKEN TRUNK - The following jobs failed but was present on the merge base:👉 Rebase onto the `viable/strict` branch to avoid these failures
This comment was automatically generated by Dr. CI and updates every 15 minutes. |
|
|
This PR needs a
|
|
LGTM. Since it touched arm code space more than lint, I will defer to experts @digantdesai @SS-JIA for stamp. |
CPPCHECK flagged apply_unary_map_reduce_fn<CTYPE, ACC> with a constStatement warning. This is a false positive — the code compiles correctly and the result is assigned to a variable used in subsequent computation. Adding const to the declarations suppresses the warning. Signed-off-by: Youngsik Yang <vacu9708@gmail.com>
e746737 to
39aa25c
Compare
|
@Gasoonjia |
e93a285ebd "Extend CPPCHECK scope to portable kernels"My work branch was cut before this new lint coverage.
Summary
CPPCHECK flagged apply_unary_map_reduce_fn<CTYPE, ACC> with a constStatement warning. This is a false positive — the code compiles correctly and the result is assigned to a variable used in subsequent computation. Adding const to the declarations suppresses the warning.
Test
$ lintrunner op_softmax.cpp op_log_softmax.cpp op_mean.cpp op_sum.cpp \ op_softmax_test.cpp op_log_softmax_test.cpp op_mean_test.cpp op_sum_test.cpp ok No lint issues.cc @digantdesai @freddan80 @per @zingo @oscarandersson8218 @mansnils @Sebastian-Larsson @robell @rascani