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

Re: [XEN PATCH] xen: rework deviation to address varargs MISRA violations


  • To: Nicola Vetrini <nicola.vetrini@xxxxxxxxxxx>, xen-devel@xxxxxxxxxxxxxxxxxxxx
  • From: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>
  • Date: Fri, 2 Jan 2026 09:42:34 +0000
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=citrix.com; dmarc=pass action=none header.from=citrix.com; dkim=pass header.d=citrix.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=CTBIoynGvjpXTtxUwXGOfeyWAeChqHuqKcbpPGXyv6s=; b=pJDO84mPC9zKyyLCsMr3VX953eKZl3UBALJeU92eRTfId0DkxjOkb8FOBbzKYN74izj+gWO71abzAqrbJer18lh7mx1D6SgZmNOpVcwIee1fshJ1ZMAZtlCXjGS8Uo49381kYTkmogQoss2YYHhuSulClwogdEYku2mcHGtouAqaPMwxn8zw8rRagN6zxAc7PubdROn3ZQphyMsXufcJqbBHvKXQfnLKg2sLGJ1KTywXT0IHZLUKqejmsX2zLPhVJ61Ay+ngnYVouaIzClYbgp28m5sctiOMUjXIbpigAtl0z8buicE9fqKNWBhocvmG0UykJAHkNA9aXIW6h+4pCQ==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=GeKuvjpijCl6DTbfwBdd7l7czTXGHr4ogTbNM4y3klCbmLHOQ5Wg+tgKqP9qtL90iXQibA4Sl1TCNsp4U+upsHKIbTGIXmac2Zp6YypOJj/ILMN1+ZVruPdkChd3NMhDgN+UsJGb/ghQhG76xnHG4DsYTjJiZOIzCW+oB7QGFGCCKOMQuRBqj9UWn1WVh79FWgQa7D9Oob1VfyW8aKoKSmGqVhu8pp7AvzVMMVIzcNnzDV7FUUO79+NbMkGhqAXwEQLp5uFmqu05VRb4B66/X904weCf38+TnlVzn9PCp//vi85ueAzPAbPdYsDxSZfEFB/i8VjJmt45fur1J7xT+Q==
  • Authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=citrix.com;
  • Cc: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>, sstabellini@xxxxxxxxxx, consulting@xxxxxxxxxxx, Doug Goldstein <cardoe@xxxxxxxxxx>, Anthony PERARD <anthony.perard@xxxxxxxxxx>, Michal Orzel <michal.orzel@xxxxxxx>, Jan Beulich <jbeulich@xxxxxxxx>, Julien Grall <julien@xxxxxxx>, Roger Pau Monné <roger.pau@xxxxxxxxxx>
  • Delivery-date: Fri, 02 Jan 2026 09:43:11 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

On 31/12/2025 11:22 am, Nicola Vetrini wrote:
> diff --git a/automation/eclair_analysis/ECLAIR/deviations.ecl 
> b/automation/eclair_analysis/ECLAIR/deviations.ecl
> index 219ba6993b90..7dee4a488d45 100644
> --- a/automation/eclair_analysis/ECLAIR/deviations.ecl
> +++ b/automation/eclair_analysis/ECLAIR/deviations.ecl
> @@ -570,13 +570,11 @@ safe."
>  # Series 17.
>  #
>  
> --doc_begin="printf()-like functions are allowed to use the variadic features 
> provided by stdarg.h."
> --config=MC3A2.R17.1,reports+={deliberate,"any_area(^.*va_list.*$&&context(ancestor_or_self(^.*printk\\(.*\\)$)))"}
> --config=MC3A2.R17.1,reports+={deliberate,"any_area(^.*va_list.*$&&context(ancestor_or_self(^.*printf\\(.*\\)$)))"}
> --config=MC3A2.R17.1,reports+={deliberate,"any_area(^.*va_list.*$&&context(ancestor_or_self(name(panic)&&kind(function))))"}
> --config=MC3A2.R17.1,reports+={deliberate,"any_area(^.*va_list.*$&&context(ancestor_or_self(name(elf_call_log_callback)&&kind(function))))"}
> --config=MC3A2.R17.1,reports+={deliberate,"any_area(^.*va_list.*$&&context(ancestor_or_self(name(vprintk_common)&&kind(function))))"}
> --config=MC3A2.R17.1,macros+={hide , "^va_(arg|start|copy|end)$"}
> +-doc_begin="printf()-like or scanf()-like functions are allowed to use the 
> variadic features provided by stdarg.h,
> +provided that they are declared using the `format' attribute."
> +-decl_selector+={format_attr, "property(format)"}
> +-config=MC3A2.R17.1,reports+={deliberate, 
> "any_area(^.*va_list.*$&&context(ancestor_or_self(format_attr)))"}
> +-config=MC3A2.R17.1,macros+={deliberate , "^va_(arg|start|copy|end)$"}
>  -doc_end
>  
>  -doc_begin="Not using the return value of a function does not endanger 
> safety if it coincides with an actual argument."
> diff --git a/docs/misra/deviations.rst b/docs/misra/deviations.rst
> index b3431ef24e26..584907b048ec 100644
> --- a/docs/misra/deviations.rst
> +++ b/docs/misra/deviations.rst
> @@ -570,8 +570,8 @@ Deviations related to MISRA C:2012 Rules:
>       - Tagged as `deliberate` for ECLAIR.
>  
>     * - R17.1
> -     - printf()-like functions  are allowed to use the variadic features 
> provided
> -       by `stdarg.h`.
> +     - printf()-like or scanf()-like functions are allowed to use the 
> variadic
> +       features provided by `stdarg.h`.
>       - Tagged as `deliberate` for ECLAIR.

Much nicer.  But don't we want to repeat the part about
__attribute__((format(...))) here?  After all, that is the justification
of why it's safer than nothing.

~Andrew



 


Rackspace

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