[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] Re: Placing of the documentation for MISRA C:2012 Directive 4.1
On 16/08/2023 21:41, Stefano Stabellini wrote: On Wed, 16 Aug 2023, Nicola Vetrini wrote:Hi, it has been agreed during past MISRA meetings that Directive 4.1("Run-time failures shall be minimized") shall be dealt with by documenting how in Xen such runtime failures are prevented, so by preparing a documentanalogous to docs/misra/C-language-toolchain.rst. A common way to deal with this in ECLAIR is to create an header fileand include it in at least one file that is part of the analyzed build, sothat the checker can see it.I am not following: why does ECLAIR need to see the documentation of howwe minimize runtimes failures in Xen? This is needed so that it can check that the document(s) supplied has the expected format. For instance, the default configuration will check headings such as the ones in the document linked in my original message: "Documentation for MISRA C:2012 Dir 4.1: overflow"and e.g. complain if an expected heading is not present (which one are expected and their format is of course configurable). One obvious candidate for this is having a .h file inside docs/misra that isincludedeither by a dummy .c file inside the same directory (and then build the docsin the analyzed configuration) or somewhere else (I came up with no good places where to include it).It could also be a standalone .c file somewhere else, but I don't think thiswould be the preferred way.ECLAIR aside, I think the primary use of this document is to be read by people: community members and assessors. So I think it would be best towrite it in a human-readable format and convert it to a .h file if that'srequired for ECLAIR.For instance, we could write it as RST file under docs/misra (RST is ourpreferred file format for documents as it can be easily converted to HTML and PDF), and then convert it into a .h file as part of the Xen build system ("make xen" takes the RST file, adds #ifndef and #endif arounds it, and creates a .h header out of it.)If it is too difficult to convert RST to .h, then also a very basic textdocument would suffice. That's a good suggestion. The RST source can be put inside a comment, so there's almost no restriction on what it contains. You can see a possible draft of the structure of this file here [1], butproviding the contenthere would require a substantial amount of collaboration with people having abroaderknowledge about Xen and its practices to prevent the runtime errors delineatedhere, so a possibility is making an RFC patch to gather some inputs to fill the sections appropriately.That makes senseAs a side note, the directive should be added to docs/misra/rules.rst. It canbe part of the patch addressing the violations, tough.[1] https://github.com/BUGSENG/eclair_demo/blob/main/ECLAIR/MISRA_C_2012_doc.h -- Nicola Vetrini, BSc Software Engineer, BUGSENG srl (https://bugseng.com)
|
Lists.xenproject.org is hosted with RackSpace, monitoring our |