[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] Re: [PATCH v1] misra: add deviation of Rule 10.1 for unary minus
Continuing a discussion from before: On 4/22/2025 11:51 PM, Jan Beulich wrote: Caution: This message originated from an External Source. Use proper caution when opening attachments, clicking links, or responding. On 23.04.2025 01:43, victorm.lira@xxxxxxx wrote:From: Nicola Vetrini <nicola.vetrini@xxxxxxxxxxx> The unary minus operator applied to an unsigned quantity has a semantics (wrap around) that is well-known to all Xen developers. Thus, this operation is deemed safe.Please, as you have it in the other two patches, can the rule title be reproduced in such patches? As it stands, without mentioning the doc version either, someone finding this later on may be left with a pretty wide ambiguity as to what's meant. OK I'll include the rule title in the commit message. --- a/automation/eclair_analysis/ECLAIR/deviations.ecl +++ b/automation/eclair_analysis/ECLAIR/deviations.ecl @@ -347,6 +347,12 @@ constant expressions are required.\"" "any()"} -doc_end +-doc_begin="Unary minus operations on non-negative integers have a semantics (wrap around) that is well-known to all Xen developers."Why "non-negative"? A variable of type "int" holding a non-negative value is, aiui, well within the bounds of the rule here. It's unsigned types where the use of unary minus would constitute a violation. You actually say so ...+ * - R10.1 + - Applying the unary minus operator to an unsigned quantity has a + semantics (wrap around) that is well-known to all Xen developers. + For this reason, the operation is safe. + - Tagged as `safe` for ECLAIR.... here, just that this one's getting blurred by using "quantity" when "type" is meant. Imo we need to be pretty precise here, using terminology that's used by the standard or the Misra rules, and not anything "coming close enough" in someone's perception. OK, I agree it should say unsigned type(s) in both of these. Victor
|
![]() |
Lists.xenproject.org is hosted with RackSpace, monitoring our |