ALTracer commented on PR #6613: URL: https://github.com/apache/incubator-nuttx/pull/6613#issuecomment-1186590308
> Yea, there won't be a "-1" bug now, but this will trigger an assert for unsigned ll bigger than ```ULONG_MAX/2```. I guess you could do: > > ```DEBUGASSERT((LONG_MIN <= x && x <= LONG_MAX) || (0 < x && x <= ULONG_MAX));``` > > To handle both signed and unsigned cases. Now I don't understand it. Can you explain how does this assert work? Do integer comparisons depend on signedness in C? Then it should be 0UL..? What is the type of x and does it matter (type promotion)? I naively think atm that this assert checks whether 64-bit x is a valid (sign-extended representation of a) 32-bit integer from LONG_MIN to ULONG_MAX inclusively. -- 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-unsubscr...@nuttx.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org