You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nuttx.apache.org by GitBox <gi...@apache.org> on 2023/01/18 14:56:53 UTC

[GitHub] [nuttx] Cynerd opened a new pull request, #8183: limits.h: add PTRDIFF_MAX and PTRDIFF_MIN

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

   ptrdiff_t is defined as int in Nuttx and thus these are same as int limits. By defining these we cover platforms where this might not be the same.
   


-- 
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


[GitHub] [nuttx] Cynerd commented on a diff in pull request #8183: limits.h: add PTRDIFF_MAX and PTRDIFF_MIN

Posted by GitBox <gi...@apache.org>.
Cynerd commented on code in PR #8183:
URL: https://github.com/apache/nuttx/pull/8183#discussion_r1073878712


##########
include/limits.h:
##########
@@ -309,4 +309,9 @@
 
 #define HOST_NAME_MAX  32
 
+/* ptrdiff_t limits */
+
+#define PTRDIFF_MAX INT_MAX

Review Comment:
   Oh.. you are right. I somehow looked it up wrongly. It is `_ssize_t`, which is defined by architecture. That makes it way more complicated.
   
   edit: Or not... correct me, but `_ssize_t` limits are defined as `PTR_MIN` and `PTR_MAX`.
   
   edit2: Except when `__SIZE_TYPE__` is used. I haven't find it being used anywhere in the code base. What is the idea behind it?



-- 
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


[GitHub] [nuttx] xiaoxiang781216 commented on a diff in pull request #8183: limits.h: add PTRDIFF_MAX and PTRDIFF_MIN

Posted by GitBox <gi...@apache.org>.
xiaoxiang781216 commented on code in PR #8183:
URL: https://github.com/apache/nuttx/pull/8183#discussion_r1073831131


##########
include/limits.h:
##########
@@ -309,4 +309,9 @@
 
 #define HOST_NAME_MAX  32
 
+/* ptrdiff_t limits */
+
+#define PTRDIFF_MAX INT_MAX

Review Comment:
   PTRDIFF_MAX isn't always equals to INT_MAX



-- 
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


[GitHub] [nuttx] Cynerd commented on a diff in pull request #8183: limits.h: add PTRDIFF_MAX and PTRDIFF_MIN

Posted by GitBox <gi...@apache.org>.
Cynerd commented on code in PR #8183:
URL: https://github.com/apache/nuttx/pull/8183#discussion_r1073878712


##########
include/limits.h:
##########
@@ -309,4 +309,9 @@
 
 #define HOST_NAME_MAX  32
 
+/* ptrdiff_t limits */
+
+#define PTRDIFF_MAX INT_MAX

Review Comment:
   Oh.. you are right. I somehow looked it up wrongly. It is `_ssize_t`, which is defined by architecture. That makes it way more complicated.



-- 
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


[GitHub] [nuttx] pkarashchenko commented on pull request #8183: limits.h: add PTRDIFF_MAX and PTRDIFF_MIN

Posted by GitBox <gi...@apache.org>.
pkarashchenko commented on PR #8183:
URL: https://github.com/apache/nuttx/pull/8183#issuecomment-1398136709

   Please rebase this PR to fix the CI


-- 
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


[GitHub] [nuttx] xiaoxiang781216 merged pull request #8183: limits.h: add PTRDIFF_MAX and PTRDIFF_MIN

Posted by GitBox <gi...@apache.org>.
xiaoxiang781216 merged PR #8183:
URL: https://github.com/apache/nuttx/pull/8183


-- 
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


[GitHub] [nuttx] Cynerd commented on a diff in pull request #8183: limits.h: add PTRDIFF_MAX and PTRDIFF_MIN

Posted by GitBox <gi...@apache.org>.
Cynerd commented on code in PR #8183:
URL: https://github.com/apache/nuttx/pull/8183#discussion_r1073878712


##########
include/limits.h:
##########
@@ -309,4 +309,9 @@
 
 #define HOST_NAME_MAX  32
 
+/* ptrdiff_t limits */
+
+#define PTRDIFF_MAX INT_MAX

Review Comment:
   Oh.. you are right. I somehow looked it up wrongly. It is `_ssize_t`, which is defined by architecture. That makes it way more complicated.
   
   edit: Or not... correct me, but `_ssize_t` limits are defined as `PTR_MIN` and `PTR_MAX`.



-- 
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