Skip to content

Fix clang warning -Wpessimizing-move and -Wunused-private-field#1866

Merged
ti-srebot merged 5 commits intopingcap:masterfrom
LittleFall:fix-clang
May 6, 2021
Merged

Fix clang warning -Wpessimizing-move and -Wunused-private-field#1866
ti-srebot merged 5 commits intopingcap:masterfrom
LittleFall:fix-clang

Conversation

@LittleFall
Copy link
Contributor

@LittleFall LittleFall commented May 6, 2021

What problem does this PR solve?

Issue Number: close #xxx

Problem Summary:

What is changed and how it works?

Proposal: xxx

What's Changed:

GCC also has copy-elision, so we can just remove the move.

The unused private member in clang will throw warning: -Wunused-private-field, but if added [[maybe_unused]], it in gcc will throw warning: 'maybe_unused' attribute ignored [-Wattributes], so I just keep clang behavior same to gcc. You can revert the modification of cmakelists after you remove all the unused members.

Related changes

  • PR to update pingcap/docs/pingcap/docs-cn:
  • Need to cherry-pick to the release branch:

Check List

Tests

  • Integration test

Side effects

Release note

  • No release note.

@LittleFall LittleFall requested review from JaySon-Huang and solotzg May 6, 2021 10:12
@LittleFall
Copy link
Contributor Author

/run-all-tests

Copy link
Contributor

@solotzg solotzg left a comment

Choose a reason for hiding this comment

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

lgtm

@ti-srebot ti-srebot added the status/LGT1 Indicates that a PR has LGTM 1. label May 6, 2021
Copy link
Contributor

@JaySon-Huang JaySon-Huang left a comment

Choose a reason for hiding this comment

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

LGTM

@ti-srebot ti-srebot removed the status/LGT1 Indicates that a PR has LGTM 1. label May 6, 2021
@ti-srebot ti-srebot added the status/LGT2 Indicates that a PR has LGTM 2. label May 6, 2021
@JaySon-Huang
Copy link
Contributor

brought by #1439

@leiysky leiysky added the type/bugfix This PR fixes a bug. label May 6, 2021
@LittleFall
Copy link
Contributor Author

/run-all-tests

@LittleFall
Copy link
Contributor Author

jenkins failed.


[2021-05-06T10:39:19.364Z] [ 94%] Building CXX object dbms/src/Functions/CMakeFiles/clickhouse_functions.dir/GatherUtils/createValueSource.cpp.o

[2021-05-06T10:39:19.364Z] [ 94%] Linking CXX static library libclickhouse_table_functionsd.a

[2021-05-06T10:39:19.364Z] [ 94%] Built target clickhouse_table_functions

[2021-05-06T10:39:19.365Z] [ 94%] Building CXX object dbms/src/Functions/CMakeFiles/clickhouse_functions.dir/GatherUtils/has.cpp.o

[2021-05-06T10:41:31.724Z] Creating placeholder flownodes because failed loading originals.

[2021-05-06T10:41:33.499Z] Setting status of 7a7dce4851fd57986703b6a52e2ee0ca704ab6b7 to FAILURE with url https://internal.pingcap.net/idc-jenkins/job/tics_ghpr_build/7819/display/redirect and message: 'Jenkins job failed

[2021-05-06T10:41:33.499Z]  '

[2021-05-06T10:41:33.499Z] Using context: idc-jenkins-ci-tics/build

[2021-05-06T10:41:34.011Z] java.io.IOException: Tried to load head FlowNodes for execution Owner[tics_ghpr_build/7819:tics_ghpr_build #7819] but FlowNode was not found in storage for head id:FlowNodeId 1:37

[2021-05-06T10:41:34.011Z] 	at org.jenkinsci.plugins.workflow.cps.CpsFlowExecution.initializeStorage(CpsFlowExecution.java:679)

[2021-05-06T10:41:34.011Z] 	at org.jenkinsci.plugins.workflow.cps.CpsFlowExecution.onLoad(CpsFlowExecution.java:716)

[2021-05-06T10:41:34.011Z] 	at org.jenkinsci.plugins.workflow.job.WorkflowRun.getExecution(WorkflowRun.java:664)

[2021-05-06T10:41:34.011Z] 	at org.jenkinsci.plugins.workflow.job.WorkflowRun.onLoad(WorkflowRun.java:526)

[2021-05-06T10:41:34.011Z] 	at hudson.model.RunMap.retrieve(RunMap.java:225)

[2021-05-06T10:41:34.011Z] 	at hudson.model.RunMap.retrieve(RunMap.java:57)

[2021-05-06T10:41:34.012Z] 	at jenkins.model.lazy.AbstractLazyLoadRunMap.load(AbstractLazyLoadRunMap.java:501)

[2021-05-06T10:41:34.012Z] 	at jenkins.model.lazy.AbstractLazyLoadRunMap.load(AbstractLazyLoadRunMap.java:483)

[2021-05-06T10:41:34.012Z] 	at jenkins.model.lazy.AbstractLazyLoadRunMap.getByNumber(AbstractLazyLoadRunMap.java:381)

[2021-05-06T10:41:34.012Z] 	at hudson.model.RunMap.getById(RunMap.java:205)

[2021-05-06T10:41:34.012Z] 	at org.jenkinsci.plugins.workflow.job.WorkflowRun$Owner.run(WorkflowRun.java:901)

[2021-05-06T10:41:34.012Z] 	at org.jenkinsci.plugins.workflow.job.WorkflowRun$Owner.get(WorkflowRun.java:912)

[2021-05-06T10:41:34.012Z] 	at org.jenkinsci.plugins.workflow.flow.FlowExecutionList$1.computeNext(FlowExecutionList.java:65)

[2021-05-06T10:41:34.012Z] 	at org.jenkinsci.plugins.workflow.flow.FlowExecutionList$1.computeNext(FlowExecutionList.java:57)

[2021-05-06T10:41:34.012Z] 	at com.google.common.collect.AbstractIterator.tryToComputeNext(AbstractIterator.java:143)

[2021-05-06T10:41:34.012Z] 	at com.google.common.collect.AbstractIterator.hasNext(AbstractIterator.java:138)

[2021-05-06T10:41:34.012Z] 	at org.jenkinsci.plugins.workflow.flow.FlowExecutionList$ItemListenerImpl.onLoaded(FlowExecutionList.java:178)

[2021-05-06T10:41:34.012Z] 	at jenkins.model.Jenkins.<init>(Jenkins.java:995)

[2021-05-06T10:41:34.012Z] 	at hudson.model.Hudson.<init>(Hudson.java:85)

[2021-05-06T10:41:34.012Z] 	at hudson.model.Hudson.<init>(Hudson.java:81)

[2021-05-06T10:41:34.012Z] 	at hudson.WebAppMain$3.run(WebAppMain.java:233)

[2021-05-06T10:41:34.012Z] Finished: FAILURE

@LittleFall
Copy link
Contributor Author

/rebuild

@LittleFall
Copy link
Contributor Author

/run-all-tests

@LittleFall LittleFall changed the title Fix clang warning -Wpessimizing-move Fix clang warning -Wpessimizing-move and -Wunused-private-field May 6, 2021
@LittleFall
Copy link
Contributor Author

/run-all-tests

@LittleFall
Copy link
Contributor Author

/run-all-tests

@LittleFall
Copy link
Contributor Author

LittleFall commented May 6, 2021

jenkins failed

[2021-05-06T13:35:28.836Z] delta-merge-test/query/mpp/aggregation_mpp.test: OK

[2021-05-06T13:35:28.836Z] delta-merge-test/query/mpp/decimal_hash.test: OK

[2021-05-06T13:35:28.836Z] delta-merge-test/query/mpp/enum_mpp.test: OK

[2021-05-06T13:35:29.411Z] delta-merge-test/query/mpp/exchange_with_timestamp_col.test: OK

[2021-05-06T13:36:40.671Z] Creating placeholder flownodes because failed loading originals.

[2021-05-06T13:36:42.398Z] Setting status of e7b0ce2e52de2319a5f2d11cde14f3e26c09c620 to FAILURE with url https://internal.pingcap.net/idc-jenkins/job/tics_ghpr_test/4578/display/redirect and message: 'Jenkins job failed

[2021-05-06T13:36:42.401Z]  '

[2021-05-06T13:36:42.401Z] Using context: idc-jenkins-ci-tics/test

[2021-05-06T13:36:42.891Z] java.io.IOException: Tried to load head FlowNodes for execution Owner[tics_ghpr_test/4578:tics_ghpr_test #4578] but FlowNode was not found in storage for head id:FlowNodeId 1:44

[2021-05-06T13:36:42.891Z] 	at org.jenkinsci.plugins.workflow.cps.CpsFlowExecution.initializeStorage(CpsFlowExecution.java:679)

[2021-05-06T13:36:42.891Z] 	at org.jenkinsci.plugins.workflow.cps.CpsFlowExecution.onLoad(CpsFlowExecution.java:716)

[2021-05-06T13:36:42.891Z] 	at org.jenkinsci.plugins.workflow.job.WorkflowRun.getExecution(WorkflowRun.java:664)

[2021-05-06T13:36:42.891Z] 	at org.jenkinsci.plugins.workflow.job.WorkflowRun.onLoad(WorkflowRun.java:526)

[2021-05-06T13:36:42.891Z] 	at hudson.model.RunMap.retrieve(RunMap.java:225)

[2021-05-06T13:36:42.891Z] 	at hudson.model.RunMap.retrieve(RunMap.java:57)

[2021-05-06T13:36:42.891Z] 	at jenkins.model.lazy.AbstractLazyLoadRunMap.load(AbstractLazyLoadRunMap.java:501)

[2021-05-06T13:36:42.891Z] 	at jenkins.model.lazy.AbstractLazyLoadRunMap.load(AbstractLazyLoadRunMap.java:483)

[2021-05-06T13:36:42.891Z] 	at jenkins.model.lazy.AbstractLazyLoadRunMap.getByNumber(AbstractLazyLoadRunMap.java:381)

[2021-05-06T13:36:42.891Z] 	at hudson.model.RunMap.getById(RunMap.java:205)

[2021-05-06T13:36:42.891Z] 	at org.jenkinsci.plugins.workflow.job.WorkflowRun$Owner.run(WorkflowRun.java:901)

[2021-05-06T13:36:42.891Z] 	at org.jenkinsci.plugins.workflow.job.WorkflowRun$Owner.get(WorkflowRun.java:912)

[2021-05-06T13:36:42.891Z] 	at org.jenkinsci.plugins.workflow.flow.FlowExecutionList$1.computeNext(FlowExecutionList.java:65)

[2021-05-06T13:36:42.891Z] 	at org.jenkinsci.plugins.workflow.flow.FlowExecutionList$1.computeNext(FlowExecutionList.java:57)

[2021-05-06T13:36:42.891Z] 	at com.google.common.collect.AbstractIterator.tryToComputeNext(AbstractIterator.java:143)

[2021-05-06T13:36:42.891Z] 	at com.google.common.collect.AbstractIterator.hasNext(AbstractIterator.java:138)

[2021-05-06T13:36:42.891Z] 	at org.jenkinsci.plugins.workflow.flow.FlowExecutionList$ItemListenerImpl.onLoaded(FlowExecutionList.java:178)

[2021-05-06T13:36:42.891Z] 	at jenkins.model.Jenkins.<init>(Jenkins.java:995)

[2021-05-06T13:36:42.891Z] 	at hudson.model.Hudson.<init>(Hudson.java:85)

[2021-05-06T13:36:42.891Z] 	at hudson.model.Hudson.<init>(Hudson.java:81)

[2021-05-06T13:36:42.891Z] 	at hudson.WebAppMain$3.run(WebAppMain.java:233)

[2021-05-06T13:36:42.891Z] Finished: FAILURE

@LittleFall
Copy link
Contributor Author

/run-all-tests

@solotzg
Copy link
Contributor

solotzg commented May 6, 2021

/merge

@ti-srebot ti-srebot added the status/can-merge Indicates a PR has been approved by a committer. label May 6, 2021
@ti-srebot
Copy link
Collaborator

/run-all-tests

@ti-srebot
Copy link
Collaborator

@LittleFall merge failed.

@LittleFall
Copy link
Contributor Author

/merge

@ti-srebot
Copy link
Collaborator

/run-all-tests

1 similar comment
@LittleFall
Copy link
Contributor Author

/run-all-tests

@ti-srebot ti-srebot merged commit 2cd9f05 into pingcap:master May 6, 2021
@JaySon-Huang JaySon-Huang deleted the fix-clang branch May 6, 2021 14:48
@JaySon-Huang
Copy link
Contributor

The unused hash_salt is brought by #1852

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

status/can-merge Indicates a PR has been approved by a committer. status/LGT2 Indicates that a PR has LGTM 2. type/bugfix This PR fixes a bug.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants