Message ID | e7e61b4486c025a1014ad09aa774dfd392f858b8.1719829101.git.alessandro.zucchelli@bugseng.com (mailing list archive) |
---|---|
State | Superseded |
Headers | show |
Series | xen: address violation of MISRA C:2012 Directive 4.10 | expand |
On 01.07.2024 13:10, Alessandro Zucchelli wrote: > --- a/docs/misra/safe.json > +++ b/docs/misra/safe.json > @@ -68,6 +68,14 @@ > }, > { > "id": "SAF-8-safe", > + "analyser": { > + "eclair": "MC3R1.D4.10" > + }, > + "name": "Dir 4.10: headers that leave it up to the caller to include them correctly", > + "text": "Headers that deliberatively avoid inclusion guards explicitly leaving responsibility to the caller are allowed." > + }, > + { > + "id": "SAF-9-safe", > "analyser": {}, > "name": "Sentinel", > "text": "Next ID to be used" Patch 10 adds another entry here, targeted at headers which are intended to be possible to include more than once. Both headers here also fit that criteria, even if right now they aren't used that way (iirc). Do we really need two SAF-* markers for effectively all the same kind of headers? > --- a/xen/include/public/arch-x86/cpufeatureset.h > +++ b/xen/include/public/arch-x86/cpufeatureset.h > @@ -23,6 +23,7 @@ > * their XEN_CPUFEATURE() being appropriate in the included context. > */ > > +/* SAF-8-safe omitted inclusion guard */ > #ifndef XEN_CPUFEATURE > > /* > diff --git a/xen/include/public/errno.h b/xen/include/public/errno.h > index 5a78a7607c..ccd5023c3a 100644 > --- a/xen/include/public/errno.h > +++ b/xen/include/public/errno.h > @@ -17,6 +17,7 @@ > * will unilaterally #undef XEN_ERRNO(). > */ > > +/* SAF-8-safe omitted inclusion guard */ > #ifndef XEN_ERRNO > > /* Further both of these headers have guards (to cover the default case), so "omitted" certainly isn't correct. Much like the "name" line in the SAF entry also isn't quite correct, as in the common case it's not left to the use sites. Jan
diff --git a/docs/misra/safe.json b/docs/misra/safe.json index 3f18ef401c..b865caac73 100644 --- a/docs/misra/safe.json +++ b/docs/misra/safe.json @@ -68,6 +68,14 @@ }, { "id": "SAF-8-safe", + "analyser": { + "eclair": "MC3R1.D4.10" + }, + "name": "Dir 4.10: headers that leave it up to the caller to include them correctly", + "text": "Headers that deliberatively avoid inclusion guards explicitly leaving responsibility to the caller are allowed." + }, + { + "id": "SAF-9-safe", "analyser": {}, "name": "Sentinel", "text": "Next ID to be used" diff --git a/xen/include/public/arch-x86/cpufeatureset.h b/xen/include/public/arch-x86/cpufeatureset.h index d9eba5e9a7..0d2adfdc3a 100644 --- a/xen/include/public/arch-x86/cpufeatureset.h +++ b/xen/include/public/arch-x86/cpufeatureset.h @@ -23,6 +23,7 @@ * their XEN_CPUFEATURE() being appropriate in the included context. */ +/* SAF-8-safe omitted inclusion guard */ #ifndef XEN_CPUFEATURE /* diff --git a/xen/include/public/errno.h b/xen/include/public/errno.h index 5a78a7607c..ccd5023c3a 100644 --- a/xen/include/public/errno.h +++ b/xen/include/public/errno.h @@ -17,6 +17,7 @@ * will unilaterally #undef XEN_ERRNO(). */ +/* SAF-8-safe omitted inclusion guard */ #ifndef XEN_ERRNO /*