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

Re: [PATCH v2] docs/misra: add 14.3


  • To: Stefano Stabellini <sstabellini@xxxxxxxxxx>
  • From: Jan Beulich <jbeulich@xxxxxxxx>
  • Date: Fri, 8 Sep 2023 08:12:57 +0200
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=suse.com; dmarc=pass action=none header.from=suse.com; dkim=pass header.d=suse.com; arc=none
  • Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=LfvkDfrchQ2tT4bjQb3qTeiSLZgpLCr4UssIjUqVRqM=; b=b8lsAgixdzySfDiwRAiwZWex4qo11mlOT8iCrL7PPPM24McBPMs+KaTuXqCwRQEt+WFgfCvY/rcveWQh8ikDLdLGH0ErztCHu7fAv5p99tXkqCwmsXjXhZXKCgeGmc7JUgu0uvYPUkmecF6GYIoD2pcyiha3BesQ8Y2Ycrv8NdtWYEP5tz3KaFimTMhQGPI4t+kO5hVlQZ7oofNhA0hxLwn6kWaUZZAGm1gq7dh0vmPEFOVKeNc/HH1H0NXOlaIjMEpPRFaYAY6+fo/xkLpr6JHsFsJlksTZ+PvaGYQUSdfIiSPUQ0N2jQjvwWQoEljwN4Dce0sHPXkGvNRJFCMH2A==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=HUks1Prq7zzZQNqtzgroJkd1fC2C7rqIqvGrcEiW8NSDOgPaz570NXZt48o7W8+E35127jKnEYvVVXFTDIX+VKZlja5JpcqE/QCAsTZ8rdmn5sW8FwxWL4omRV451mGfNT1OC5OyapYG9t9R0SjN4FPadOOdE41UTAzC77sD6cFk1+tmlrmNAjLRvaWFLcFF8M4F5tDgNL6W6C4VA/RLtaYBo4LBl9aTcGnxuOI4Dy0iLb11x+MNCVqAZ3Vild92cYkzP2bnNkPKhF3gYmw8PJLD3NmuGs8CcIJwijHW3aTUIxX4QpkI2eDtuOCMSiMK52uZ+zfAHhl14NUpAPrv6g==
  • Authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=suse.com;
  • Cc: andrew.cooper3@xxxxxxxxxx, roger.pau@xxxxxxxxxx, julien@xxxxxxx, george.dunlap@xxxxxxxxxx, bertrand.marquis@xxxxxxx, roberto.bagnara@xxxxxxxxxxx, nicola.vetrini@xxxxxxxxxxx, Stefano Stabellini <stefano.stabellini@xxxxxxx>, xen-devel@xxxxxxxxxxxxxxxxxxxx
  • Delivery-date: Fri, 08 Sep 2023 06:13:19 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

On 07.09.2023 23:45, Stefano Stabellini wrote:
> On Thu, 7 Sep 2023, Jan Beulich wrote:
>> On 07.09.2023 03:22, Stefano Stabellini wrote:
>>> @@ -385,6 +386,17 @@ maintainers if you want to suggest a change.
>>>       - A loop counter shall not have essentially floating type
>>>       -
>>>  
>>> +   * - `Rule 14.3 
>>> <https://gitlab.com/MISRA/MISRA-C/MISRA-C-2012/Example-Suite/-/blob/master/R_14_03.c>`_
>>> +     - Required
>>> +     - Controlling expressions shall not be invariant
>>> +     - Due to the extensive usage of IS_ENABLED, sizeof compile-time
>>> +       checks, and other constructs that are detected as errors by MISRA
>>> +       C scanners, managing the configuration of a MISRA C scanner for
>>> +       this rule would be unmanageable. Thus, this rule is adopted with
>>> +       a project-wide deviation on if ?: and switch statements.
>>
>> Do we want to go as far as permitting this uniformly for all switch()? In
>> my earlier reply I had included sizeof() for a reason.
>  
> I agree with you that it would be better to restrict it to only some
> switch uses, rather than all of them.
> 
> But if we are going to restrict the deviation to switch(sizeof()), which
> I think is a good idea and I am in favor, wouldn't it be better to
> handle these cases as individual deviations? E.g. docs/misra/safe.json?
> I am assuming there are only few cases like that and adding it here
> makes the rule more complicated.

Personally I think it wants to be both anyway. For one, anything written
here still needs respective SAF annotations for scanners to be uniformly
aware (dealing with deviations in just the Eclair configuration is imo
dubious). And then my general view is that by stating patterns here we
make clear that we tolerate new instances of such constructs, whereas in
other cases we'd be aiming at no deviations in new code.

Jan



 


Rackspace

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