Skip to content

Commit

Permalink
automation/eclair: add a deviation for MISRA C:2012 Rule 8.6
Browse files Browse the repository at this point in the history
Update ECLAIR configuration to take into account the search
procedure adopted by Unix linkers.
Update deviations.rst accordingly and tag Rule 8.6 as "clean".

Signed-off-by: Federico Serafini <[email protected]>
Reviewed-by: Stefano Stabellini <[email protected]>
  • Loading branch information
FedericoSerafini authored and sstabellini committed Nov 18, 2023
1 parent 26cdd09 commit 83e9e30
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 1 deletion.
11 changes: 11 additions & 0 deletions automation/eclair_analysis/ECLAIR/deviations.ecl
Original file line number Diff line number Diff line change
Expand Up @@ -172,6 +172,17 @@ definition is compiled-out or optimized-out by the compiler)"
-config=MC3R1.R8.6,reports+={deliberate, "first_area(^.*has no definition$)"}
-doc_end

-doc_begin="The search procedure for Unix linkers is well defined, see ld(1)
manual: \"The linker will search an archive only once, at the location where it
is specified on the command line. If the archive defines a symbol which was
undefined in some object which appeared before the archive on the command line,
the linker will include the appropriate file(s) from the archive\".
In Xen, thanks to the order in which file names appear in the build commands,
if arch-specific definitions are present, they get always linked in before
searching in the lib.a archive resulting from xen/lib."
-config=MC3R1.R8.6,declarations+={deliberate, "loc(file(^xen/lib/.*$))"}
-doc_end

-doc_begin="The gnu_inline attribute without static is deliberately allowed."
-config=MC3R1.R8.10,declarations+={deliberate,"property(gnu_inline)"}
-doc_end
Expand Down
2 changes: 1 addition & 1 deletion automation/eclair_analysis/ECLAIR/tagging.ecl
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@

-doc_begin="Clean guidelines: new violations for these guidelines are not accepted."

-service_selector={clean_guidelines_common,"MC3R1.D1.1||MC3R1.D2.1||MC3R1.D4.11||MC3R1.D4.14||MC3R1.R1.1||MC3R1.R1.3||MC3R1.R1.4||MC3R1.R2.2||MC3R1.R3.1||MC3R1.R3.2||MC3R1.R4.1||MC3R1.R4.2||MC3R1.R5.1||MC3R1.R5.2||MC3R1.R5.4||MC3R1.R6.1||MC3R1.R6.2||MC3R1.R7.1||MC3R1.R8.1||MC3R1.R8.5||MC3R1.R8.8||MC3R1.R8.10||MC3R1.R8.12||MC3R1.R8.14||MC3R1.R9.2||MC3R1.R9.4||MC3R1.R9.5||MC3R1.R12.5||MC3R1.R17.3||MC3R1.R17.4||MC3R1.R17.6||MC3R1.R20.13||MC3R1.R20.14||MC3R1.R21.13||MC3R1.R21.19||MC3R1.R21.21||MC3R1.R22.2||MC3R1.R22.4||MC3R1.R22.5||MC3R1.R22.6"
-service_selector={clean_guidelines_common,"MC3R1.D1.1||MC3R1.D2.1||MC3R1.D4.11||MC3R1.D4.14||MC3R1.R1.1||MC3R1.R1.3||MC3R1.R1.4||MC3R1.R2.2||MC3R1.R3.1||MC3R1.R3.2||MC3R1.R4.1||MC3R1.R4.2||MC3R1.R5.1||MC3R1.R5.2||MC3R1.R5.4||MC3R1.R6.1||MC3R1.R6.2||MC3R1.R7.1||MC3R1.R8.1||MC3R1.R8.5||MC3R1.R8.6||MC3R1.R8.8||MC3R1.R8.10||MC3R1.R8.12||MC3R1.R8.14||MC3R1.R9.2||MC3R1.R9.4||MC3R1.R9.5||MC3R1.R12.5||MC3R1.R17.3||MC3R1.R17.4||MC3R1.R17.6||MC3R1.R20.13||MC3R1.R20.14||MC3R1.R21.13||MC3R1.R21.19||MC3R1.R21.21||MC3R1.R22.2||MC3R1.R22.4||MC3R1.R22.5||MC3R1.R22.6"
}

-setq=target,getenv("XEN_TARGET_ARCH")
Expand Down
12 changes: 12 additions & 0 deletions docs/misra/deviations.rst
Original file line number Diff line number Diff line change
Expand Up @@ -153,6 +153,18 @@ Deviations related to MISRA C:2012 Rules:
definition is compiled-out or optimized-out by the compiler).
- Tagged as `deliberate` in ECLAIR.

* - R8.6
- The search procedure for Unix linkers is well defined, see ld(1) manual:
"The linker will search an archive only once, at the location where it
is specified on the command line. If the archive defines a symbol which
was undefined in some object which appeared before the archive on the
command line, the linker will include the appropriate file(s) from the
archive".
In Xen, thanks to the order in which file names appear in the build
commands, if arch-specific definitions are present, they get always
linked in before searching in the lib.a archive resulting from xen/lib.
- Tagged as `deliberate` for ECLAIR.

* - R8.10
- The gnu_inline attribute without static is deliberately allowed.
- Tagged as `deliberate` for ECLAIR.
Expand Down

0 comments on commit 83e9e30

Please sign in to comment.