You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nuttx.apache.org by "XuNeo (via GitHub)" <gi...@apache.org> on 2024/10/31 05:39:31 UTC

[PR] mm/mm_gran: fix compile warnings [nuttx]

XuNeo opened a new pull request, #14575:
URL: https://github.com/apache/nuttx/pull/14575

   
   *Note: Please adhere to [Contributing Guidelines](https://github.com/apache/nuttx/blob/master/CONTRIBUTING.md).*
   
   ## Summary
   
   mm_gran/mm_grantable.c:187:6: error: 'r.sidx' may be used uninitialized
   
   
   ## Impact
   
   Warning fix only
   
   ## Testing
   
   CI build pass.
   
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@nuttx.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] mm/mm_gran: fix compile warnings [nuttx]

Posted by "xiaoxiang781216 (via GitHub)" <gi...@apache.org>.
xiaoxiang781216 merged PR #14575:
URL: https://github.com/apache/nuttx/pull/14575


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@nuttx.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] mm/mm_gran: fix compile warnings [nuttx]

Posted by "anchao (via GitHub)" <gi...@apache.org>.
anchao commented on code in PR #14575:
URL: https://github.com/apache/nuttx/pull/14575#discussion_r1823928903


##########
mm/mm_gran/mm_grantable.c:
##########
@@ -174,6 +174,7 @@ bool gran_match(const gran_t *gran, size_t posi, size_t size, bool used,
   uint32_t e;   /* expected cell value */
   gatr_t   r;   /* range helper */
 
+  memset(&r, 0, sizeof(r)); /* clear the range explicitly to avoid warnings */
   gran_range(gran, posi, size, &r);

Review Comment:
   ```suggestion
     if (gran_range(gran, posi, size, &r) < 0)
       {
         memset(&r, 0, sizeof(r));
       }
   ```



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@nuttx.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] mm/mm_gran: fix compile warnings [nuttx]

Posted by "lupyuen (via GitHub)" <gi...@apache.org>.
lupyuen commented on PR #14575:
URL: https://github.com/apache/nuttx/pull/14575#issuecomment-2461598361

   Sorry I have to cancel the CI Check, there's a problem with CI Test:
   - https://github.com/apache/nuttx/pull/14667#issuecomment-2461197521


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@nuttx.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] mm/mm_gran: fix compile warnings [nuttx]

Posted by "anchao (via GitHub)" <gi...@apache.org>.
anchao commented on code in PR #14575:
URL: https://github.com/apache/nuttx/pull/14575#discussion_r1824032787


##########
mm/mm_gran/mm_grantable.c:
##########
@@ -174,6 +174,7 @@ bool gran_match(const gran_t *gran, size_t posi, size_t size, bool used,
   uint32_t e;   /* expected cell value */
   gatr_t   r;   /* range helper */
 
+  memset(&r, 0, sizeof(r)); /* clear the range explicitly to avoid warnings */
   gran_range(gran, posi, size, &r);

Review Comment:
   Sure, but some additional testing may be needed. we could memset the `getr_t r` on failure case if we just want to clear the warning, which is consistent with the previous semantics.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@nuttx.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] mm/mm_gran: fix compile warnings [nuttx]

Posted by "XuNeo (via GitHub)" <gi...@apache.org>.
XuNeo commented on code in PR #14575:
URL: https://github.com/apache/nuttx/pull/14575#discussion_r1824026295


##########
mm/mm_gran/mm_grantable.c:
##########
@@ -174,6 +174,7 @@ bool gran_match(const gran_t *gran, size_t posi, size_t size, bool used,
   uint32_t e;   /* expected cell value */
   gatr_t   r;   /* range helper */
 
+  memset(&r, 0, sizeof(r)); /* clear the range explicitly to avoid warnings */
   gran_range(gran, posi, size, &r);

Review Comment:
   Should here return `false` directly, same as what `failure` does?



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@nuttx.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org