linguini1 commented on PR #17300:
URL: https://github.com/apache/nuttx/pull/17300#issuecomment-3517290237

   > Hmm, everyone can agree that rtcb can never be NULL, but what if we missed 
something? Or, what if future changes in the codebase miss something? It's 
probably a good idea to check with DEBUGASSERT, to give us a chance to catch 
programmer mistakes in the future, and as a way of explicitly documenting the 
function's contract.
   
   If my assumptions are correct (because I'm still not certain why the `rtcb` 
cannot be NULL in this function), I think this PR claims that the rtcb is never 
NULL because this function is not called in the early-boot phase, which is the 
only time that `rtcb` could be NULL. If that is the case, I support keeping the 
DEBUGASSERT as well since it's possible that later on some developer will try 
to call `sched_lock` in the early-boot phase.
   
   However, I think if my assumption is right then a patch should be submitted 
to update the comment on the function. I.e: "note: this function should never 
be called in the early-boot phase when `rtcb` is NULL"


-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to