[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Xen-devel] [RFC PATCH 0/4] Add missing default labels to switch statements



Hi,

On 2/26/19 9:10 PM, Stefano Stabellini wrote:
On Mon, 25 Feb 2019, Julien Grall wrote:
Hi,

On 2/25/19 9:13 PM, Stefano Stabellini wrote:
I think it is fine to exploit compiler specific checks when available.
However, I don't think we should make any decisions on code correctness
based on the compiler checks that we introduce.

In other words, I think it is a good idea to use -Wswitch-enum if
possible, but it is not a reason for not having default labels in place
as suggested by 16.4. The code should be as correct and safe as
possible, without requiring external compiler-specific checks.

As I said on an answer to Oleksandr, I am not against of having "default"
labels as long as they contain sensible actions.

Good!


But this does not really address my point above regarding way to help the
review. Jan is against -Wswitch-enum, and I can understand his point. So how
do you deal with missing item?

I wonder if Coverity or PRQA can help with that.

I would be really surprised if Coverity or PRQA were able to detect a missing item in the enumeration if you have the 'default' label.

On a similar topic, we never reached to the point where Xen Arm is automatically covered by Coverity. At the moment, we rely on EPAM to push time to time. As we argue on getting the code safer, I think it is time to get this finally run by osstest.

I suspect this should be one of the step the less controversial for Xen community :).

Cheers,


--
Julien Grall

_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxxx
https://lists.xenproject.org/mailman/listinfo/xen-devel

 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.