On 15.03.2024 01:35, Stefano Stabellini wrote:
> --- a/docs/misra/rules.rst
> +++ b/docs/misra/rules.rst
> @@ -181,6 +181,21 @@ maintainers if you want to suggest a change.
>         headers (xen/include/public/) are allowed to retain longer
>         identifiers for backward compatibility.
>  
> +   * - `Rule 5.5 
> <https://gitlab.com/MISRA/MISRA-C/MISRA-C-2012/Example-Suite/-/blob/master/R_05_05.c>`_
> +     - Required
> +     - Identifiers shall be distinct from macro names
> +     - Macros expanding to their own name are allowed, e.g.::
> +
> +           #define x x
> +
> +       Clashes between names of function-like macros and identifiers of
> +       non-callable entities are allowed. Callable entities having an
> +       identifier that is the same of the name of a
> +       function-like macro are not allowed. Example (not allowed)::
> +
> +           #define f(x, y) f(x, y);

The semicolon here wants dropping, just to not give questionable constructs
as examples.

> +           void f(int x, int y);

With this not allowed and there (iirc) being examples of such in the code,
I'll be curious how it is meant to deal with them.

Jan

Reply via email to