-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
Refactor/gh13222 util deprecate #13223
Refactor/gh13222 util deprecate #13223
Conversation
needs some more testing first |
I don't think a purely lexical solution will work. I prefer @fwcd's suggestion. I'll see how many warnings it creates and evaluate from there how easy it will be to remove them. |
If the function is deprecated and is no longer to be used, having contributors look into it is IMO a good thing, given that those call sites should be refactored anyway. This is the purpose of these warnings, to draw attention to code snippets that should be updated. If we really need to keep it around, we may look into suppressing it on a case-by-case basis. |
1a610fa
to
1c90a8f
Compare
apart from the formal deprecation warnings, this is ready for review. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
src/widget/paintable.cpp requires also #include
I strongly disagree. The contributor should always start over with a clean build without any warning. This is important to keep the barrier for new contributors low. A new contributor cannot understand what it means, unless we define a receipt for a fix. We may rather work on this as the core team in a branch with warnings enabled. I also consider it not as an urgent task. Because the old code is known good and tested. Every change involves a degree of a regression risk. I don't like to review PRs with new code and deprecation warning fixes. |
Yeah, that's fair and it makes sense to me to reduce the number of warnings as much as possible, hence my idea that we could suppress warnings as needed (though the downside is that C++ doesn't seem to have a standard mechanism for this and adding different compiler-specific pragmas might add even more noise) Do we have an idea of how many such warnings we would get? If the number is manageable, maybe we could fix the issues on |
Thanks for looking into this. Having warning, which shows as annotation on PR or in the pre-commit would be very valuable I think |
what header would that be? don't see any class from |
I disagree. I think applying the "Boy Scout Rule" (Robert C. Martin) is an important tactic in combating code rot. Outlawing it would result in PRs that is either just a feature (that is explicitly not improving code quality, especially because we sometimes even enforce using outdated practices "for consistency") or PRs that are just refactorings and cleanup (for which ppl don't have incentive to review because it doesn't result in a new exciting feature). Do you see the dilemma here? |
If you don't like the warnings, we can either keep it deprecated "informally" as I have done now, or I can issue another pull request that removes the deprecated classes entirely. The latter approach resulting in a PR that is likely to get neglected because of the reasons I mentioned in the previous comments. |
mixxx/src/widget/paintable.cpp Line 58 in da261b6
|
The whole question boils down to:
If yes and one has interest to do it, than go ahead. In the later case we don't have yet a convenient way to enable the warning only for new code. But I think the current solution in this PR is good enough for now. |
IMO yes.
I would start an attempt. I may not be able to succeed entirely, but I'm fairly confident a large number of occurrences could be eliminated at which point disabling warnings for select files would become feasible.
Thank you. I agree for now. At least with the informal deprecation, people have the chance to know that a types use is discouraged, even if they aren't scolded for it by the compiler. Whoops thank you. fixed. |
2b6b710
to
d150a55
Compare
friendly ping |
I have not managed to test the ReferenceHolder changes. The 2.5-beta PRs have a higher prio for me. |
d150a55
to
e40e268
Compare
done #13240 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, thank you.
src/util/messagepipe.h
Outdated
rigtorp::SPSCQueue<ReceiverMessageType>& m_sender_messages; | ||
QScopedPointer<BaseReferenceHolder> m_pTwoWayMessagePipeReference; | ||
std::shared_ptr<rigtorp::SPSCQueue<SenderMessageType>> m_receiver_messages; | ||
std::shared_ptr<rigtorp::SPSCQueue<ReceiverMessageType>> m_sender_messages; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please use a m_p prefix
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
whoops sorry. do you want me to open a follow up PR?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This was a pending comment for the other PR.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe we have confused GitHub 😎
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ah, yea. I'll fix it there then
as requested in #13222
One primary issue is that marking entire classes
[[deprecated]]
will result in build failures due to-Wdeprecated -Werror
. So marking them deprecated formally would require their removal in the same step. That's why I only made them deprecated in the form of a comment.