[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] Re: [XEN PATCH] misra: deviate violations of Rule 21.6
On Tue, 1 Jul 2025, Dmytro Prokopchuk1 wrote: > From: Federico Serafini <federico.serafini@xxxxxxxxxxx> > > MISRA C Rule 21.6 states that "The Standard Library input/output > functions shall not be used". > > Xen does not use the functions provided by the Standard Library, > uses -nostdlib to ensure this. > Xen implements a set of functions that share the same names as their > Standard Library equivalent. The implementation of these functions is > available in source form: if some undefined or unspecified behavior > does arise in the implementation, it falls under the jurisdiction of > other MISRA guidelines. > > Update ECLAIR configuration to deviate violations of the rule, > tag it as clean and add it to the monitored set. > > Updated docs/misra/deviations.rst accordingly. > > Signed-off-by: Federico Serafini <federico.serafini@xxxxxxxxxxx> > Signed-off-by: Dmytro Prokopchuk <dmytro_prokopchuk1@xxxxxxxx> Reviewed-by: Stefano Stabellini <sstabellini@xxxxxxxxxx> > --- > > The latest Eclair analysis shows 20 violations (ARM64 and X86_64) of the rule > MC3A2.R21.6. > In details: > 14 violations - use of function `snprintf(char*, size_t, const char*, ...)' > (<stdio.h>) > 6 violations - use of function `vsnprintf(char*, size_t, const char*, > va_list)' (<stdio.h>) > As mentioned before Xen doen't use Standard Library input/output functions. > It implements its own functions in the common/vsprintf.c. > So this Rule can be deviated. > > automation/eclair_analysis/ECLAIR/deviations.ecl | 3 ++- > automation/eclair_analysis/ECLAIR/monitored.ecl | 1 + > automation/eclair_analysis/ECLAIR/tagging.ecl | 1 + > docs/misra/deviations.rst | 11 ++++++++++- > 4 files changed, 14 insertions(+), 2 deletions(-) > > diff --git a/automation/eclair_analysis/ECLAIR/deviations.ecl > b/automation/eclair_analysis/ECLAIR/deviations.ecl > index 9c67358d46..3a4d9ee3c0 100644 > --- a/automation/eclair_analysis/ECLAIR/deviations.ecl > +++ b/automation/eclair_analysis/ECLAIR/deviations.ecl > @@ -650,7 +650,8 @@ implements a set of functions that share the same names > as their Standard Librar > The implementation of these functions is available in source form, so the > undefined, unspecified > or implementation-defined behaviors contemplated by the C Standard do not > apply. > If some undefined or unspecified behavior does arise in the implementation, > it > -falls under the jurisdiction of other MISRA rules." > +falls under the jurisdiction of other MISRA guidelines." > +-config=MC3A2.R21.6,reports+={deliberate, "any()"} > -config=MC3A2.R21.9,reports+={deliberate, "any()"} > -config=MC3A2.R21.10,reports+={deliberate, "any()"} > -doc_end > diff --git a/automation/eclair_analysis/ECLAIR/monitored.ecl > b/automation/eclair_analysis/ECLAIR/monitored.ecl > index ca2f5e3c7f..e2ad224d79 100644 > --- a/automation/eclair_analysis/ECLAIR/monitored.ecl > +++ b/automation/eclair_analysis/ECLAIR/monitored.ecl > @@ -82,6 +82,7 @@ > -enable=MC3A2.R20.14 > -enable=MC3A2.R21.3 > -enable=MC3A2.R21.4 > +-enable=MC3A2.R21.6 > -enable=MC3A2.R21.5 > -enable=MC3A2.R21.7 > -enable=MC3A2.R21.8 > diff --git a/automation/eclair_analysis/ECLAIR/tagging.ecl > b/automation/eclair_analysis/ECLAIR/tagging.ecl > index f9da5d5f4d..5bf214f480 100644 > --- a/automation/eclair_analysis/ECLAIR/tagging.ecl > +++ b/automation/eclair_analysis/ECLAIR/tagging.ecl > @@ -93,6 +93,7 @@ MC3A2.R20.14|| > MC3A2.R21.3|| > MC3A2.R21.4|| > MC3A2.R21.5|| > +MC3A2.R21.6|| > MC3A2.R21.7|| > MC3A2.R21.8|| > MC3A2.R21.9|| > diff --git a/docs/misra/deviations.rst b/docs/misra/deviations.rst > index fe0b1e10a2..6cd8f48c91 100644 > --- a/docs/misra/deviations.rst > +++ b/docs/misra/deviations.rst > @@ -587,7 +587,16 @@ Deviations related to MISRA C:2012 Rules: > construct is deviated only in Translation Units that present a > violation > of the Rule due to uses of this macro. > - Tagged as `deliberate` for ECLAIR. > - > + > + * - R21.6 > + - Xen does not use the input/output functions provided by the C > + Standard Library, but provides in source form its own implementation, > + therefore any unspecified or undefined behavior associated to the > + functions provided by the Standard Library does not apply. Any such > + behavior that may exist in such functions is therefore under the > + jurisdiction of other MISRA C guidelines. > + - Tagged as `deliberate` for ECLAIR. > + > * - R21.9 > - Xen does not use the `bsearch` and `qsort` functions provided by the C > Standard Library, but provides in source form its own implementation, > -- > 2.43.0 >
|
![]() |
Lists.xenproject.org is hosted with RackSpace, monitoring our |