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

Re: [PATCH v2] add more MISRA C rules to docs/misra/rules.rst


  • To: Stefano Stabellini <sstabellini@xxxxxxxxxx>
  • From: Jan Beulich <jbeulich@xxxxxxxx>
  • Date: Tue, 14 Jun 2022 08:59:02 +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=qiqIR0YoJJTjxfG2FKh0K6nz6+HM3MUd+UjnkTQzW3c=; b=TfVWtqqz9kz04jE46M2S6FLvD6nfMKA8AUGgQWtD/+MMO5h41UXQUYBU/lSkQYgAtjW3Hna/vL6SBM8BzkvgtTj9qyX765XrH5otWebw13+UEgYh8FG1xKTIhZF8kvqM5RgLKZV3ypiCXZqICq6dPwHGGFWIryeOmy2f9G14Z/Zfbmq0JDdidWcvIKB8wF63cU5RCPYh/VtJE2EkuNMdvddGpvLKUbGmUzjrnk2Q88ml4UaGvb2c6/8trEvRpcWqFnrw5Iomlu4Dxh2xTzwD/Jli2Vb95yGwOX43yfSgxwj3oKz2UulF3zjhvsPCU22PZbaeWQ2YkgAMj/EpbEGTRA==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=U2+f32U0APJl+VeMpz1jwiyzw2AngewjS1pnXRlhE0/p07+LgqToPta02wkK4rIJrq90+XFlCPSoXcvBgz90IT/g8xjkONaAqJfepeG0quGNDnw48C+ajTgnqeq//jKxU0fCTCXxOzdSxUBWD736xANlvBPZ873vXv+x8gbvRB2YFk/JGJGJI+PZY/2x5s/eDeqL173ozyfIrHb3gGEqA1rbAO9Bv5l/QEYqMqQ9YpxxjVW243rdh7xZnofHwNeUcAsLy/Ew958gRv1B59lF7PlqAwY7+hFRQlT8oXcydAek2ALKlquEWEkE03opl5sYlFjrbp3LMT6kIB24xMOX5g==
  • Authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=suse.com;
  • Cc: George.Dunlap@xxxxxxxxxx, roger.pau@xxxxxxxxxx, Artem_Mygaiev@xxxxxxxx, Andrew.Cooper3@xxxxxxxxxx, julien@xxxxxxx, Bertrand.Marquis@xxxxxxx, Stefano Stabellini <stefano.stabellini@xxxxxxxxxx>, Julien Grall <jgrall@xxxxxxxxxx>, xen-devel@xxxxxxxxxxxxxxxxxxxx
  • Delivery-date: Tue, 14 Jun 2022 06:59:14 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

On 14.06.2022 01:29, Stefano Stabellini wrote:
> On Mon, 13 Jun 2022, Jan Beulich wrote:
>> On 10.06.2022 23:27, Stefano Stabellini wrote:
>>> +   * - `Rule 5.3 
>>> <https://gitlab.com/MISRA/MISRA-C/MISRA-C-2012/Example-Suite/-/blob/master/R_05_03.c>`_
>>> +     - Required
>>> +     - An identifier declared in an inner scope shall not hide an
>>> +       identifier declared in an outer scope
>>> +     - Using macros as macro parameters at invocation time is allowed
>>> +       even if both macros use identically named local variables, e.g.
>>> +       max_t(var0, min_t(var1, var2))
>>
>> Nit: I would have been okay with the prior use of MIN() and MAX() in this
>> example, but now that you have switched to min_t() / max_t() I think the
>> example also wants to match our macros of these names. Hence I'd like to
>> suggest that either you switch to using min() / max() (which also use
>> local variables), or you add the missing "type" arguments in both macro
>> invocations.
> 
> I see your point. I'll use min/max as follows:
> 
> max(var0, min(var1, var2))
> 
> If you are OK with that and there are no other suggestions this tiny
> change could be done on commit.

Yes, that's fine with me.

Jan



 


Rackspace

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