Amend generation script to address a violation of MISRA C:2012 Directive 4.10 ("Precautions shall be taken in order to prevent the contents of a header file being included more than once").
This patch adds a special comment to the beginning of the header to make it explicit that the file is generated automatically. The comment is recognized by ECLAIR and will cause the deviation of the violation. Signed-off-by: Simone Ballarin <simone.balla...@bugseng.com> --- xen/tools/compat-xlat-header.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/xen/tools/compat-xlat-header.py b/xen/tools/compat-xlat-header.py index 2b805b23a8..9e336277ac 100644 --- a/xen/tools/compat-xlat-header.py +++ b/xen/tools/compat-xlat-header.py @@ -406,6 +406,8 @@ def main(): line = line.strip() header_tokens += re_tokenazier.split(line) + print("/* Generated file, do not edit! */") + with open(sys.argv[2]) as compat_list: for line in compat_list: words = re_tokenazier.split(line, maxsplit=1) -- 2.34.1