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

Re: [PATCH] docs/misra: document gcc-specific behavior with shifting signed integers


  • To: Stefano Stabellini <sstabellini@xxxxxxxxxx>
  • From: Jan Beulich <jbeulich@xxxxxxxx>
  • Date: Mon, 21 Aug 2023 09:17:16 +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=7qYDr79cjjTJeLcBqVX/vv/SaPOHQNoRE+hAF9Pg1VU=; b=kq7N2hlTF3u8g6/c2Cqv7t3R+8Hc7X4I4Ht0myoMvc76dG7/OqAGu9LcggTWOaRljnHtKl3Aehcdq++Wg6wryR1sS41yiWctS3rI11DujfOvi8uP5l0zuqEXnFF0W9gas70CUzAzzsW5u3SnSmSWyufpNQqzcqv+hW0JMr9KiEMiZ4Y6YRBC7QvFh9OAqUpPFUgLTFByTPz3Agqz+aOP7LzzY+0SNO2VGVf7bzKxVdujtzmEkCjHyOj98yqVIqyvTGxYbSew5YUGn/FecoLzVf1U/IzIoLUo1xdFdmJRjncCpug+vDSVBJ+9eYv9ui2sq6K/4myjV5Z1irdjdt2nZw==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=CubBdbilDiK/upV/sEjV3C/Db14AkP60ghtHDWoHLtX6KrIiWvom8j1Ax5B1yF+x6wIDs/OyLza9Ebc21r5nkTDkIFgBCxZpIh4RQ+lXq/37fh9HXfqVAFj3wdSDNe3FmCMbf/OwQuvSs0yXEmzuQH9t7qqyLoDrzv8BENOTMthl9VBVgNM2f6gxEhiEWLL0WnkArmKKXI7O2/nbxZmDeYX/cEG5T9r8HlpXiqgJ77vh0j0ayn14jTEgu7JoetwTlp7L/kEcJAsTBDqQOGxR5nixSe0YEWff42+jyb/BDLzdUFEGBDhruw136rlDsVlX0xaJOrPiOGrkYnksqtmp5Q==
  • 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, bertrand.marquis@xxxxxxx, Stefano Stabellini <stefano.stabellini@xxxxxxx>, xen-devel@xxxxxxxxxxxxxxxxxxxx
  • Delivery-date: Mon, 21 Aug 2023 07:17:24 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

On 19.08.2023 02:33, Stefano Stabellini wrote:
> From: Stefano Stabellini <stefano.stabellini@xxxxxxx>
> 
> Signed-off-by: Stefano Stabellini <stefano.stabellini@xxxxxxx>
> ---
> Changes in v2:
> - use "shift" instead of << or >>
> - use All Architectures (I haven't changed all the other instances of
> x86/arm in the file yet)
> ---
>  docs/misra/C-language-toolchain.rst | 6 ++++++
>  1 file changed, 6 insertions(+)
> 
> diff --git a/docs/misra/C-language-toolchain.rst 
> b/docs/misra/C-language-toolchain.rst
> index 785aed1eaf..f5ca7bd2c8 100644
> --- a/docs/misra/C-language-toolchain.rst
> +++ b/docs/misra/C-language-toolchain.rst
> @@ -200,6 +200,12 @@ The table columns are as follows:
>       - ARM64, X86_64
>       - See Section "6.29 Designated Initializers" of GCC_MANUAL
>  
> +   * - Signed shift acts on negative numbers by sign extension
> +     - All architectures
> +     - See Section "4.5 Integers" of GCC_MANUAL. As an extension to the
> +       C language, GCC does not use the latitude given in C99 and C11
> +       only to treat certain aspects of signed shift as undefined.

I'm sorry, but that's still not what the doc says. Replacing << and >> by
"shifts" was imo wrong. What's needed instead is that either this is split
into two top-level bullet points (one for << and one for >>), or the first
sub-bullet-point (which acts as kind of the title) be generalized, with
the << and >> details fully moved to the "explanatory" sub-bullet-point.

Jan



 


Rackspace

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