-
Notifications
You must be signed in to change notification settings - Fork 8
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
Fix Clang 15 warnings #81
base: master
Are you sure you want to change the base?
Conversation
Hmm, what do I have to do to enable GHA (and Appveyor?) builds for this repo? |
I believe that some workflow must be defined on whichever is the default branch before GHA will build for PRs. |
Thanks, that idea also occurred to me overnight as well, I will rebase my commits and merge the GHA and Appveyor additions immediately. Any ideas why the 3.15 build wasn't checking out and building pvData and pvAccess as stand-alone dependencies before building the main module in this run? |
Probably because they are not defined as dependent modules. For 7.0, this works as they are part of Base (check-out with submodules is default). |
@ralphlange Don't these lines in the .ci-local/default.set file do that?
The pva2pva module's CI builds them correctly with 3.15, so I copied that file exactly. Is there something else I need to configure? |
|
Aargh, thanks that fixed 3.15 but broke the RTEMS cross-builds. I'll look at updating the GHA script. |
Remove the unused private field by that name. Make prevAlarmRange use that enum.
Success, I will push the CI changes to master, then rebase this PR on top. |
e952ea6
to
035b285
Compare
For this, and similar, I think it would be useful to document the precise warning(s) seen to help search engines direct people to this issue, and hopefully avoid duplicates. (I am trying to be more consistent about this myself...)
I am unsure of the original intent. Maybe an attempt at the C pattern
A common suspicion with these APIs. Still, this is an incompatible change to a public API, and I think should be communicated as such. I had to look more than twice to (maybe) understand what is going on here. Having the compiler warning text would help. I think the compiler complaint is having two virtual methods with different argument lists ( Did you (or @sveseli) look at adding c++11 fyi. adding With Further, if you really want to prevent the two argument version from being called through From the RELEASE_NOTES
The canonical way to express this intent would be with a pure virtual method. Though again, it would mean an API change. |
virtual bool init( | ||
epics::pvData::PVFieldPtr const & pvValue, | ||
epics::pvData::PVFieldPtr const & pvSupport) {return true;} | ||
bool init() {return false;} |
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.
I am unsure what the original intent was here, but if all classes that inherit from PVSupport were supposed to have init(pvValue, pvSupport), I do not see a problem with leaving this (and ControlSupport class) as it was, and only changing/renaming init() method on line 48 in ScalarAlarmSupport, which would presumably fix the warnings, and would be a smaller API change. I do not quite see a point of introducing a new init() method here that is not being used. Sorry if I am missing something...
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.
I think Marty was suggesting that classes derived from PVSupport would provide their own init()
method to set up the their added member data, as his class ScalarAlarmSupport
(in src/pv/scalarAlarmSupport.{h,cpp}
) does. His Doxygen comment said the method would be optional (line 41 above) implying that some might not need to, but I think that in most cases the derived class would need additional parameters anyway (as class ScalarAlarmSupport
does), so it doesn't actually make sense for init()
to be a virtual method with a fixed set of parameters anyway.
My change was written to try and keep what I thought his design intent was. If we don't care about that then I agree that these changes to the base class are unnecessary.
I am not using PVSupport and its derived classes, and I am not aware of anyone else using them. |
When building this module (without these changes) using
I get these warnings:
|
The latest version of this PR only fixes compiler warnings from Clang-15. Earlier versions also changed the CI to use GHA and Appveyor, but those have been merged into master already.
The first commit fixes compiler warnings from Clang-15 about an internal
AlarmRange
enum.The second commit changes an API that I suspect isn't actually being used by anyone (@sveseli please check that, see the description in the RELEASE_NOTES) which was overloading a virtual method improperly, leading to more warnings.