Message ID | alpine.DEB.2.22.394.2411151617580.1160299@ubuntu-linux-20-04-desktop (mailing list archive) |
---|---|
State | New |
Headers | show |
Series | misra: increase identifiers length to 64 | expand |
On Sat, Nov 16, 2024 at 12:23 AM Stefano Stabellini <sstabellini@kernel.org> wrote: > > Currently the identifiers characters limit is arbitrarily set to 40. It > causes a few violations as we have some identifiers longer than 40. > > Increase the limit to another rather arbitrary limit of 64. Thanks to > this change, we remove a few violations, getting us one step closer to > marking Rules 5.2 and 5.4 as clean. > > Also update the ECLAIR config that was actually set to 63 as character > limit. > > Signed-off-by: Stefano Stabellini <stefano.stabellini@amd.com> > > diff --git a/automation/eclair_analysis/ECLAIR/toolchain.ecl b/automation/eclair_analysis/ECLAIR/toolchain.ecl > index 86e9a79b52..8fb1778bce 100644 > --- a/automation/eclair_analysis/ECLAIR/toolchain.ecl > +++ b/automation/eclair_analysis/ECLAIR/toolchain.ecl > @@ -155,8 +155,8 @@ > -doc_end > > -doc_begin="See Section \"4.3 Identifiers\" of "GCC_MANUAL"." > --config=STD.extidsig, behavior+={c99, GCC_ARM64, "63"} > --config=STD.extidsig, behavior+={c99, GCC_X86_64, "63"} > +-config=STD.extidsig, behavior+={c99, GCC_ARM64, "64"} > +-config=STD.extidsig, behavior+={c99, GCC_X86_64, "64"} > -doc_end > > # > diff --git a/docs/misra/rules.rst b/docs/misra/rules.rst > index 4a144da8d6..3ed5801bff 100644 > --- a/docs/misra/rules.rst > +++ b/docs/misra/rules.rst > @@ -154,7 +154,7 @@ maintainers if you want to suggest a change. > * - `Rule 5.1 <https://gitlab.com/MISRA/MISRA-C/MISRA-C-2012/Example-Suite/-/blob/master/R_05_01_2.c>`_ > - Required > - External identifiers shall be distinct > - - The Xen characters limit for identifiers is 40. Public headers > + - The Xen characters limit for identifiers is 64. Public headers > (xen/include/public/) are allowed to retain longer identifiers > for backward compatibility. > Do we need to retain this comments about public headers or now with 64 characters they all fit into the limit? > @@ -162,7 +162,7 @@ maintainers if you want to suggest a change. > - Required > - Identifiers declared in the same scope and name space shall be > distinct > - - The Xen characters limit for identifiers is 40. Public headers > + - The Xen characters limit for identifiers is 64. Public headers > (xen/include/public/) are allowed to retain longer identifiers > for backward compatibility. > > @@ -177,7 +177,7 @@ maintainers if you want to suggest a change. > * - `Rule 5.4 <https://gitlab.com/MISRA/MISRA-C/MISRA-C-2012/Example-Suite/-/blob/master/R_05_04.c>`_ > - Required > - Macro identifiers shall be distinct > - - The Xen characters limit for macro identifiers is 40. Public > + - The Xen characters limit for macro identifiers is 64. Public > headers (xen/include/public/) are allowed to retain longer > identifiers for backward compatibility. > > Frediano
On 2024-11-16 01:23, Stefano Stabellini wrote: > Currently the identifiers characters limit is arbitrarily set to 40. It > causes a few violations as we have some identifiers longer than 40. > > Increase the limit to another rather arbitrary limit of 64. Thanks to > this change, we remove a few violations, getting us one step closer to > marking Rules 5.2 and 5.4 as clean. > > Also update the ECLAIR config that was actually set to 63 as character > limit. > > Signed-off-by: Stefano Stabellini <stefano.stabellini@amd.com> > > diff --git a/automation/eclair_analysis/ECLAIR/toolchain.ecl b/automation/eclair_analysis/ECLAIR/toolchain.ecl > index 86e9a79b52..8fb1778bce 100644 > --- a/automation/eclair_analysis/ECLAIR/toolchain.ecl > +++ b/automation/eclair_analysis/ECLAIR/toolchain.ecl > @@ -155,8 +155,8 @@ > -doc_end > > -doc_begin="See Section \"4.3 Identifiers\" of "GCC_MANUAL"." > --config=STD.extidsig, behavior+={c99, GCC_ARM64, "63"} > --config=STD.extidsig, behavior+={c99, GCC_X86_64, "63"} > +-config=STD.extidsig, behavior+={c99, GCC_ARM64, "64"} > +-config=STD.extidsig, behavior+={c99, GCC_X86_64, "64"} > -doc_end > > # > diff --git a/docs/misra/rules.rst b/docs/misra/rules.rst > index 4a144da8d6..3ed5801bff 100644 > --- a/docs/misra/rules.rst > +++ b/docs/misra/rules.rst > @@ -154,7 +154,7 @@ maintainers if you want to suggest a change. > * - `Rule 5.1 <https://gitlab.com/MISRA/MISRA-C/MISRA-C-2012/Example-Suite/-/blob/master/R_05_01_2.c>`_ > - Required > - External identifiers shall be distinct > - - The Xen characters limit for identifiers is 40. Public headers > + - The Xen characters limit for identifiers is 64. Public headers > (xen/include/public/) are allowed to retain longer identifiers > for backward compatibility. > > @@ -162,7 +162,7 @@ maintainers if you want to suggest a change. > - Required > - Identifiers declared in the same scope and name space shall be > distinct > - - The Xen characters limit for identifiers is 40. Public headers > + - The Xen characters limit for identifiers is 64. Public headers > (xen/include/public/) are allowed to retain longer identifiers > for backward compatibility. > > @@ -177,7 +177,7 @@ maintainers if you want to suggest a change. > * - `Rule 5.4 <https://gitlab.com/MISRA/MISRA-C/MISRA-C-2012/Example-Suite/-/blob/master/R_05_04.c>`_ > - Required > - Macro identifiers shall be distinct > - - The Xen characters limit for macro identifiers is 40. Public > + - The Xen characters limit for macro identifiers is 64. Public > headers (xen/include/public/) are allowed to retain longer > identifiers for backward compatibility. While for external identifiers 64 can be considered as random as 63, for internal identifiers and macro names 63, which is what the C99 standard guarantees, is better than 64 (which is one more than the standard guarantees). Kind regards, Roberto
On 16.11.2024 01:23, Stefano Stabellini wrote: > Currently the identifiers characters limit is arbitrarily set to 40. It > causes a few violations as we have some identifiers longer than 40. > > Increase the limit to another rather arbitrary limit of 64. Thanks to > this change, we remove a few violations, getting us one step closer to > marking Rules 5.2 and 5.4 as clean. > > Also update the ECLAIR config that was actually set to 63 as character > limit. What I don't really understand: With the Eclair config already having said 63, how come we did see patches aiming at dealing with the limit being just 40? IOW - how would those (supposed) issue even have been spotted. Jan
On 2024-11-18 09:58, Jan Beulich wrote: > On 16.11.2024 01:23, Stefano Stabellini wrote: >> Currently the identifiers characters limit is arbitrarily set to 40. >> It >> causes a few violations as we have some identifiers longer than 40. >> >> Increase the limit to another rather arbitrary limit of 64. Thanks to >> this change, we remove a few violations, getting us one step closer to >> marking Rules 5.2 and 5.4 as clean. >> >> Also update the ECLAIR config that was actually set to 63 as character >> limit. > > What I don't really understand: With the Eclair config already having > said > 63, how come we did see patches aiming at dealing with the limit being > just > 40? IOW - how would those (supposed) issue even have been spotted. > Hi Jan, the issue was spotted by Andrew, and therefore we made the patches to align the configuration with the limits chosen by the project, which makes those violations appear. It is also possibile to do it the other way around (align the rst with the ECLAIR configuration), which spares the need for additional deviations. In that case, I agree that 63 is better than 64.
On Mon, 18 Nov 2024, Nicola Vetrini wrote: > On 2024-11-18 09:58, Jan Beulich wrote: > > On 16.11.2024 01:23, Stefano Stabellini wrote: > > > Currently the identifiers characters limit is arbitrarily set to 40. It > > > causes a few violations as we have some identifiers longer than 40. > > > > > > Increase the limit to another rather arbitrary limit of 64. Thanks to > > > this change, we remove a few violations, getting us one step closer to > > > marking Rules 5.2 and 5.4 as clean. > > > > > > Also update the ECLAIR config that was actually set to 63 as character > > > limit. > > > > What I don't really understand: With the Eclair config already having said > > 63, how come we did see patches aiming at dealing with the limit being just > > 40? IOW - how would those (supposed) issue even have been spotted. > > > > Hi Jan, > > the issue was spotted by Andrew, and therefore we made the patches to align > the configuration with the limits chosen by the project, which makes those > violations appear. It is also possibile to do it the other way around (align > the rst with the ECLAIR configuration), which spares the need for additional > deviations. > > In that case, I agree that 63 is better than 64. Actually, I was wondering the same question as Jan when writing this patch. Thanks Jan for asking explicitly and thanks Nicola for clarifying. I'll resend using 63.
diff --git a/automation/eclair_analysis/ECLAIR/toolchain.ecl b/automation/eclair_analysis/ECLAIR/toolchain.ecl index 86e9a79b52..8fb1778bce 100644 --- a/automation/eclair_analysis/ECLAIR/toolchain.ecl +++ b/automation/eclair_analysis/ECLAIR/toolchain.ecl @@ -155,8 +155,8 @@ -doc_end -doc_begin="See Section \"4.3 Identifiers\" of "GCC_MANUAL"." --config=STD.extidsig, behavior+={c99, GCC_ARM64, "63"} --config=STD.extidsig, behavior+={c99, GCC_X86_64, "63"} +-config=STD.extidsig, behavior+={c99, GCC_ARM64, "64"} +-config=STD.extidsig, behavior+={c99, GCC_X86_64, "64"} -doc_end # diff --git a/docs/misra/rules.rst b/docs/misra/rules.rst index 4a144da8d6..3ed5801bff 100644 --- a/docs/misra/rules.rst +++ b/docs/misra/rules.rst @@ -154,7 +154,7 @@ maintainers if you want to suggest a change. * - `Rule 5.1 <https://gitlab.com/MISRA/MISRA-C/MISRA-C-2012/Example-Suite/-/blob/master/R_05_01_2.c>`_ - Required - External identifiers shall be distinct - - The Xen characters limit for identifiers is 40. Public headers + - The Xen characters limit for identifiers is 64. Public headers (xen/include/public/) are allowed to retain longer identifiers for backward compatibility. @@ -162,7 +162,7 @@ maintainers if you want to suggest a change. - Required - Identifiers declared in the same scope and name space shall be distinct - - The Xen characters limit for identifiers is 40. Public headers + - The Xen characters limit for identifiers is 64. Public headers (xen/include/public/) are allowed to retain longer identifiers for backward compatibility. @@ -177,7 +177,7 @@ maintainers if you want to suggest a change. * - `Rule 5.4 <https://gitlab.com/MISRA/MISRA-C/MISRA-C-2012/Example-Suite/-/blob/master/R_05_04.c>`_ - Required - Macro identifiers shall be distinct - - The Xen characters limit for macro identifiers is 40. Public + - The Xen characters limit for macro identifiers is 64. Public headers (xen/include/public/) are allowed to retain longer identifiers for backward compatibility.
Currently the identifiers characters limit is arbitrarily set to 40. It causes a few violations as we have some identifiers longer than 40. Increase the limit to another rather arbitrary limit of 64. Thanks to this change, we remove a few violations, getting us one step closer to marking Rules 5.2 and 5.4 as clean. Also update the ECLAIR config that was actually set to 63 as character limit. Signed-off-by: Stefano Stabellini <stefano.stabellini@amd.com>