<div dir="ltr"><div dir="ltr"><br></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Mon, Oct 5, 2020 at 2:18 AM Sebastian Huber <<a href="mailto:sebastian.huber@embedded-brains.de">sebastian.huber@embedded-brains.de</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">On 04/10/2020 06:18, Kinsey Moore wrote:<br>
<br>
> Fix spmsgq_err01 on systems with 64-bit pointers and correct max value<br>
> mismatches and inaccuracies that are more noticable on 64-bit systems.<br>
> ---<br>
> testsuites/sptests/spmsgq_err01/init.c | 6 +++---<br>
> 1 file changed, 3 insertions(+), 3 deletions(-)<br>
><br>
> diff --git a/testsuites/sptests/spmsgq_err01/init.c b/testsuites/sptests/spmsgq_err01/init.c<br>
> index c68d30da16..9a6a8855be 100644<br>
> --- a/testsuites/sptests/spmsgq_err01/init.c<br>
> +++ b/testsuites/sptests/spmsgq_err01/init.c<br>
> @@ -101,7 +101,7 @@ rtems_task Init(<br>
> /* not enough memory for messages */<br>
> status = rtems_message_queue_create(<br>
> Queue_name[ 1 ],<br>
> - SIZE_MAX / ( sizeof( uintptr_t ) + sizeof( CORE_message_queue_Buffer ) ),<br>
> + UINT_MAX / ( sizeof( uintptr_t ) + sizeof( CORE_message_queue_Buffer ) ),<br>
I think this should be UINT32_MAX. However, on a 64-bit system this test <br>
case doesn't produce the intended error case.<br>
> 1,<br>
I think we need here something like MIN(SIZE_MAX / UINT32_MAX, 1)).<br>
> RTEMS_DEFAULT_ATTRIBUTES,<br>
> &Queue_id[ 1 ]<br>
> @@ -116,8 +116,8 @@ rtems_task Init(<br>
> /* too large a request for messages */<br>
> status = rtems_message_queue_create(<br>
> Queue_name[ 1 ],<br>
> - INT_MAX,<br>
> - INT_MAX,<br>
> + UINT_MAX,<br>
UINT32_MAX?<br></blockquote><div><br></div><div>The signature is his:</div><div><br></div>rtems_status_code rtems_message_queue_create(<br> rtems_name name,<br> uint32_t count,<br> size_t max_message_size,<br> rtems_attribute attribute_set,<br> rtems_id *id<br>)</div><div class="gmail_quote"><br></div><div class="gmail_quote">UINT32_MAX is right for count.</div><div class="gmail_quote"><br></div><div class="gmail_quote">SIZE_MAX is right for max_message_size.</div><div class="gmail_quote"><br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"> > + SIZE_MAX - sizeof( uintptr_t ) + 1 - sizeof( CORE_message_queue_Buffer ),<br>
> RTEMS_DEFAULT_ATTRIBUTES,<br>
> &Queue_id[ 1 ]<br>
> );<br>
I am not sure about these changes.<br>
_______________________________________________<br>
devel mailing list<br>
<a href="mailto:devel@rtems.org" target="_blank">devel@rtems.org</a><br>
<a href="http://lists.rtems.org/mailman/listinfo/devel" rel="noreferrer" target="_blank">http://lists.rtems.org/mailman/listinfo/devel</a><br>
</blockquote></div></div>