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

Re: [PATCH v3] misra: allow discarding 'noreturn' during function pointer conversions


  • To: Jan Beulich <jbeulich@xxxxxxxx>
  • From: Dmytro Prokopchuk1 <dmytro_prokopchuk1@xxxxxxxx>
  • Date: Thu, 31 Jul 2025 16:48:33 +0000
  • Accept-language: en-US, uk-UA, ru-RU
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=epam.com; dmarc=pass action=none header.from=epam.com; dkim=pass header.d=epam.com; arc=none
  • Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; 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=uzUZaIaTjl2BqusVKImSmE0hjO688BNvqMwAaOLEoqQ=; b=HFlzSifvsINukcjfGYgTZt8uyslEhgGcQnYBaADXyzq23hvjUIodPn8o3jlodc+zJraLZ8OkTNJ/vjToMx6BVEs3lFbsm5mh0KuTHjxHnFYV5kSwqMlW6Oy4QH5etCnUOnzc/Q+nmzxOtHx2rChSZ8NYZL/kPnZsdNcFhnLP7BPaQiLwGutz7bjVEhmyPl0gYtz9UgdadNmaszI21gWJqL7E2Mv+JhPXPSGFq3Yaapsg6WrMkHQIMUrW2aFxtuaZUDAp5fhp1lGebEoip7szw+1KvAgUTuCbQnVnLOZVeuzr4q4VmDZbfZOZf3fEkBlyuv5MCHY31xxL4n5h75BQ+Q==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=WUsO4U5KLrbjN6gOMvxSxGUi/S1aqhIp7RHwQwLNtXHGJ+AACuBWPr0YOFppOneoM+DmwTTNpHzTyhLWn1u9nK7gAihDInUW7rZ2hdnDG1l64kjGsx7zxfKgzXgNxSTTTmfjZ+N0CnHuuJDWtwpmMGu6BYmMN1ARmoBcs3dmAPOSYADBZsqbjqjn6GUkczeaJ36Ptp1AljUY4iQOIxz/WZV9cxJC6XYmKb9YVudCqax3BVOSh7K7i/DeFCtFjgrk2xJTGm/hRjj3u0mvN+/QyVs6K9bjyR+rq0N/oOIFeW5+qavZ1gSG8oLzGZf8gUAa+qKvcaLihbLUCJ3bvexm5w==
  • Authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=epam.com;
  • Cc: Nicola Vetrini <nicola.vetrini@xxxxxxxxxxx>, Doug Goldstein <cardoe@xxxxxxxxxx>, Stefano Stabellini <sstabellini@xxxxxxxxxx>, Andrew Cooper <andrew.cooper3@xxxxxxxxxx>, Anthony PERARD <anthony.perard@xxxxxxxxxx>, Michal Orzel <michal.orzel@xxxxxxx>, Julien Grall <julien@xxxxxxx>, Roger Pau Monné <roger.pau@xxxxxxxxxx>, "xen-devel@xxxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxxx>
  • Delivery-date: Thu, 31 Jul 2025 16:48:51 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
  • Thread-index: AQHcAZuXMk8luH5qyUihUMZTH0cl+7RL1AuAgACepIA=
  • Thread-topic: [PATCH v3] misra: allow discarding 'noreturn' during function pointer conversions


On 7/31/25 10:20, Jan Beulich wrote:
> On 30.07.2025 23:47, Dmytro Prokopchuk1 wrote:
>> --- a/docs/misra/deviations.rst
>> +++ b/docs/misra/deviations.rst
>> @@ -342,6 +342,12 @@ Deviations related to MISRA C:2012 Rules:
>>          semantics that do not lead to unexpected behaviour.
>>        - Tagged as `safe` for ECLAIR.
>>   
>> +   * - R11.1
>> +     - The conversion from 'void noreturn (*)(void *)' to 'void (*)(void *)'
>> +       is safe because the semantics of the 'noreturn' attribute do not 
>> alter
>> +       the calling convention or behavior of the resulting code.
>> +     - Tagged as `safe` for ECLAIR.
> 
> As before, imo such a deviation should be generic, i.e. here independent
> of what parameters a function takes. If that can't be easily expressed
> to Eclair, then that wants stating as a justification for the
> deviations.ecl change to not fully cover the deviation we put in place.
> Having the textual deviation generic means later possible needs can be
> easily addressed by just a deviations.ecl change, without any adjustment
> to the deviations themselves.
> 
> Jan

Hi, Jan

Currently Eclair checks exact pointer type 'void (*)(void *)', as 
described in the configuration:

to(type(pointer(inner(return(builtin(void))&&all_param(1, 
pointer(builtin(void)))))))

Nicola wrote: "then if it needs to be extended when more cases emerge I 
can do that".

So, for clarification.

1. In the file "deviations.ecl" I leave exist description and config:
"The conversion from 'void noreturn (*)(void *)' to 'void (*)(void *)' 
is safe because the semantics of the 'noreturn' attribute do not alter 
the calling convention or behavior of the resulting code."

2. In the file "deviations.rst" I change the description to:
"The conversion from `void noreturn (*)(...)` to `void (*)(...)`
is safe because the semantics of the 'noreturn' attribute do not alter
the calling convention or behavior of the resulting code, parameter 
handling remain consistent."

3. In the file "rules.rst" I change the description to:
"Conversions from 'void noreturn (*)(...)' to 'void (*)(...)' are 
permitted."

It means that only "deviations.ecl" needs to be updated if a new 
deviation needs to be addressed.


Is it OK?

Dmytro

 


Rackspace

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