Re: [PATCH v3] docs/misra: add R21.6 R21.9 R21.10 R21.14 R21.15 R21.16

2024-05-21 Thread Bertrand Marquis
Hi Stefano,


> On 26 Apr 2024, at 23:36, Stefano Stabellini  wrote:
> 
> Signed-off-by: Stefano Stabellini 

You might want to answer to Andrew on the footnote and agree or not on his way 
to fix.

Appart from that:
Acked-by: Bertrand Marquis 

Cheers
Bertrand


> ---
> 
> Changes in v3:
> - add explanation in footnote
> - remove comment from 21.14, 21.15, 21.16
> 
> docs/misra/rules.rst | 42 ++
> 1 file changed, 42 insertions(+)
> 
> diff --git a/docs/misra/rules.rst b/docs/misra/rules.rst
> index b7b447e152..5ba7394f05 100644
> --- a/docs/misra/rules.rst
> +++ b/docs/misra/rules.rst
> @@ -652,12 +652,48 @@ maintainers if you want to suggest a change.
>declared
>  - See comment for Rule 21.1
> 
> +   * - `Rule 21.6 
> `_
> + - Required
> + - The Standard Library input/output routines shall not be used
> + - Xen doesn't provide, use, or link against a Standard Library [1]_
> +
> +   * - `Rule 21.9 
> `_
> + - Required
> + - The library functions bsearch and qsort of  shall not be 
> used
> + - Xen doesn't provide, use, or link against a Standard Library [1]_
> +
> +   * - `Rule 21.10 
> `_
> + - Required
> + - The Standard Library time and date routines shall not be used
> + - Xen doesn't provide, use, or link against a Standard Library [1]_
> +
>* - `Rule 21.13 
> `_
>  - Mandatory
>  - Any value passed to a function in  shall be representable as 
> an
>unsigned char or be the value EOF
>  -
> 
> +   * - `Rule 21.14 
> `_
> + - Required
> + - The Standard Library function memcmp shall not be used to compare
> +   null terminated strings
> + -
> +
> +   * - `Rule 21.15 
> `_
> + - Required
> + - The pointer arguments to the Standard Library functions memcpy,
> +   memmove and memcmp shall be pointers to qualified or unqualified
> +   versions of compatible types
> + -
> +
> +   * - `Rule 21.16 
> `_
> + - Required
> + - The pointer arguments to the Standard Library function memcmp
> +   shall point to either a pointer type, an essentially signed type,
> +   an essentially unsigned type, an essentially Boolean type or an
> +   essentially enum type
> + - void* arguments are allowed
> +
>* - `Rule 21.17 
> `_
>  - Mandatory
>  - Use of the string handling functions from  shall not result 
> in
> @@ -712,3 +748,9 @@ maintainers if you want to suggest a change.
>  - The value of a pointer to a FILE shall not be used after the associated
>stream has been closed
>  -
> +
> +
> +.. [1] Xen implements itself a few functions with names that match the
> +   corresponding function names of the Standard Library for developers'
> +   convenience. These functions are part of the Xen code and subject to
> +   analysis.
> -- 
> 2.25.1
> 




Re: [PATCH v3] docs/misra: add R21.6 R21.9 R21.10 R21.14 R21.15 R21.16

2024-05-10 Thread Andrew Cooper
On 10/05/2024 10:48 pm, Andrew Cooper wrote:
> On 26/04/2024 10:36 pm, Stefano Stabellini wrote:
>> Signed-off-by: Stefano Stabellini 
>> ---
>>
>> Changes in v3:
>> - add explanation in footnote
>> - remove comment from 21.14, 21.15, 21.16
>>
>>  docs/misra/rules.rst | 42 ++
>>  1 file changed, 42 insertions(+)
>>
>> diff --git a/docs/misra/rules.rst b/docs/misra/rules.rst
>> index b7b447e152..5ba7394f05 100644
>> --- a/docs/misra/rules.rst
>> +++ b/docs/misra/rules.rst
>> @@ -652,12 +652,48 @@ maintainers if you want to suggest a change.
>> declared
>>   - See comment for Rule 21.1
>>  
>> +   * - `Rule 21.6 
>> `_
>> + - Required
>> + - The Standard Library input/output routines shall not be used
>> + - Xen doesn't provide, use, or link against a Standard Library [1]_
>> +
>> +   * - `Rule 21.9 
>> `_
>> + - Required
>> + - The library functions bsearch and qsort of  shall not be 
>> used
>> + - Xen doesn't provide, use, or link against a Standard Library [1]_
>> +
>> +   * - `Rule 21.10 
>> `_
>> + - Required
>> + - The Standard Library time and date routines shall not be used
>> + - Xen doesn't provide, use, or link against a Standard Library [1]_
>> +
>> * - `Rule 21.13 
>> `_
>>   - Mandatory
>>   - Any value passed to a function in  shall be representable 
>> as an
>> unsigned char or be the value EOF
>>   -
>>  
>> +   * - `Rule 21.14 
>> `_
>> + - Required
>> + - The Standard Library function memcmp shall not be used to compare
>> +   null terminated strings
>> + -
>> +
>> +   * - `Rule 21.15 
>> `_
>> + - Required
>> + - The pointer arguments to the Standard Library functions memcpy,
>> +   memmove and memcmp shall be pointers to qualified or unqualified
>> +   versions of compatible types
>> + -
>> +
>> +   * - `Rule 21.16 
>> `_
>> + - Required
>> + - The pointer arguments to the Standard Library function memcmp
>> +   shall point to either a pointer type, an essentially signed type,
>> +   an essentially unsigned type, an essentially Boolean type or an
>> +   essentially enum type
>> + - void* arguments are allowed
>> +
>> * - `Rule 21.17 
>> `_
>>   - Mandatory
>>   - Use of the string handling functions from  shall not 
>> result in
>> @@ -712,3 +748,9 @@ maintainers if you want to suggest a change.
>>   - The value of a pointer to a FILE shall not be used after the 
>> associated
>> stream has been closed
>>   -
>> +
>> +
>> +.. [1] Xen implements itself a few functions with names that match the
>> +   corresponding function names of the Standard Library for developers'
>> +   convenience. These functions are part of the Xen code and subject to
>> +   analysis.
> I discovered the hard way (c/s 1357f1fa588f1) that numbered footnotes
> are an issue when the document gets more complicated.
>
> I'd suggest using #xen-stdlib as a named footnote instead of [1].
>
> Can fix on commit.

And a ".. rubric:: Footnotes" is wanted too.  Fixed on commit, after
conferring with Stefano.

~Andrew



Re: [PATCH v3] docs/misra: add R21.6 R21.9 R21.10 R21.14 R21.15 R21.16

2024-05-10 Thread Andrew Cooper
On 26/04/2024 10:36 pm, Stefano Stabellini wrote:
> Signed-off-by: Stefano Stabellini 
> ---
>
> Changes in v3:
> - add explanation in footnote
> - remove comment from 21.14, 21.15, 21.16
>
>  docs/misra/rules.rst | 42 ++
>  1 file changed, 42 insertions(+)
>
> diff --git a/docs/misra/rules.rst b/docs/misra/rules.rst
> index b7b447e152..5ba7394f05 100644
> --- a/docs/misra/rules.rst
> +++ b/docs/misra/rules.rst
> @@ -652,12 +652,48 @@ maintainers if you want to suggest a change.
> declared
>   - See comment for Rule 21.1
>  
> +   * - `Rule 21.6 
> `_
> + - Required
> + - The Standard Library input/output routines shall not be used
> + - Xen doesn't provide, use, or link against a Standard Library [1]_
> +
> +   * - `Rule 21.9 
> `_
> + - Required
> + - The library functions bsearch and qsort of  shall not be 
> used
> + - Xen doesn't provide, use, or link against a Standard Library [1]_
> +
> +   * - `Rule 21.10 
> `_
> + - Required
> + - The Standard Library time and date routines shall not be used
> + - Xen doesn't provide, use, or link against a Standard Library [1]_
> +
> * - `Rule 21.13 
> `_
>   - Mandatory
>   - Any value passed to a function in  shall be representable as 
> an
> unsigned char or be the value EOF
>   -
>  
> +   * - `Rule 21.14 
> `_
> + - Required
> + - The Standard Library function memcmp shall not be used to compare
> +   null terminated strings
> + -
> +
> +   * - `Rule 21.15 
> `_
> + - Required
> + - The pointer arguments to the Standard Library functions memcpy,
> +   memmove and memcmp shall be pointers to qualified or unqualified
> +   versions of compatible types
> + -
> +
> +   * - `Rule 21.16 
> `_
> + - Required
> + - The pointer arguments to the Standard Library function memcmp
> +   shall point to either a pointer type, an essentially signed type,
> +   an essentially unsigned type, an essentially Boolean type or an
> +   essentially enum type
> + - void* arguments are allowed
> +
> * - `Rule 21.17 
> `_
>   - Mandatory
>   - Use of the string handling functions from  shall not result 
> in
> @@ -712,3 +748,9 @@ maintainers if you want to suggest a change.
>   - The value of a pointer to a FILE shall not be used after the 
> associated
> stream has been closed
>   -
> +
> +
> +.. [1] Xen implements itself a few functions with names that match the
> +   corresponding function names of the Standard Library for developers'
> +   convenience. These functions are part of the Xen code and subject to
> +   analysis.

I discovered the hard way (c/s 1357f1fa588f1) that numbered footnotes
are an issue when the document gets more complicated.

I'd suggest using #xen-stdlib as a named footnote instead of [1].

Can fix on commit.

~Andrew





[PATCH v3] docs/misra: add R21.6 R21.9 R21.10 R21.14 R21.15 R21.16

2024-04-26 Thread Stefano Stabellini
Signed-off-by: Stefano Stabellini 
---

Changes in v3:
- add explanation in footnote
- remove comment from 21.14, 21.15, 21.16

 docs/misra/rules.rst | 42 ++
 1 file changed, 42 insertions(+)

diff --git a/docs/misra/rules.rst b/docs/misra/rules.rst
index b7b447e152..5ba7394f05 100644
--- a/docs/misra/rules.rst
+++ b/docs/misra/rules.rst
@@ -652,12 +652,48 @@ maintainers if you want to suggest a change.
declared
  - See comment for Rule 21.1
 
+   * - `Rule 21.6 
`_
+ - Required
+ - The Standard Library input/output routines shall not be used
+ - Xen doesn't provide, use, or link against a Standard Library [1]_
+
+   * - `Rule 21.9 
`_
+ - Required
+ - The library functions bsearch and qsort of  shall not be used
+ - Xen doesn't provide, use, or link against a Standard Library [1]_
+
+   * - `Rule 21.10 
`_
+ - Required
+ - The Standard Library time and date routines shall not be used
+ - Xen doesn't provide, use, or link against a Standard Library [1]_
+
* - `Rule 21.13 
`_
  - Mandatory
  - Any value passed to a function in  shall be representable as an
unsigned char or be the value EOF
  -
 
+   * - `Rule 21.14 
`_
+ - Required
+ - The Standard Library function memcmp shall not be used to compare
+   null terminated strings
+ -
+
+   * - `Rule 21.15 
`_
+ - Required
+ - The pointer arguments to the Standard Library functions memcpy,
+   memmove and memcmp shall be pointers to qualified or unqualified
+   versions of compatible types
+ -
+
+   * - `Rule 21.16 
`_
+ - Required
+ - The pointer arguments to the Standard Library function memcmp
+   shall point to either a pointer type, an essentially signed type,
+   an essentially unsigned type, an essentially Boolean type or an
+   essentially enum type
+ - void* arguments are allowed
+
* - `Rule 21.17 
`_
  - Mandatory
  - Use of the string handling functions from  shall not result in
@@ -712,3 +748,9 @@ maintainers if you want to suggest a change.
  - The value of a pointer to a FILE shall not be used after the associated
stream has been closed
  -
+
+
+.. [1] Xen implements itself a few functions with names that match the
+   corresponding function names of the Standard Library for developers'
+   convenience. These functions are part of the Xen code and subject to
+   analysis.
-- 
2.25.1