xen/include: make enum perfcounter anonymous

Using enumerators declared in a named enum, such as the one modified,
as operands to arithmetic operators is not allowed by MISRA C:2012 Rule 10.1.
The enumerators of an anonymous enum can be used instead.

Signed-off-by: Nicola Vetrini <nicola.vetrini@bugseng.com>
Reviewed-by: Stefano Stabellini <sstabellini@kernel.org>
This commit is contained in:
Nicola Vetrini authored and Stefano Stabellini committed 2023-11-02 14:58:56 -07:00
1 parent 7211904e09
commit ea083911b1
2 files changed
+4 -1

No files matched your search

+3
View File
@@ -341,6 +341,9 @@ maintainers if you want to suggest a change.
compilers' extensions)
- Implicit conversions to boolean for conditionals (?: if while
for) and logical operators (! || &&)
- The essential type model allows the constants defined by anonymous
enums (e.g., enum { A, B, C }) to be used as operands to arithmetic
operators, as they have a signed essential type.
* - `Rule 10.2 <https://gitlab.com/MISRA/MISRA-C/MISRA-C-2012/Example-Suite/-/blob/master/R_10_02.c>`_
- Required
Reference in new issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.