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 2022/10/11 08:28:54 UTC

[GitHub] [incubator-nuttx-apps] ttnie opened a new pull request, #1344: examples: clean warning of pipe

ttnie opened a new pull request, #1344:
URL: https://github.com/apache/incubator-nuttx-apps/pull/1344

   
   ## Summary
   clean example pipe build warning 
   
   transfer_test.c:66:12: error: cast from pointer to integer of different size [-Werror=pointer-to-int-cast]
      int fd = (int)pvarg;
               ^
   transfer_test.c: In function 'transfer_writer':
   transfer_test.c:122:12: error: cast from pointer to integer of different size [-Werror=pointer-to-int-cast]
      int fd = (int)pvarg;
               ^
   transfer_test.c: In function 'transfer_test':
   transfer_test.c:169:58: error: cast to pointer from integer of different size [-Werror=int-to-pointer-cast]
      ret = pthread_create(&readerid, NULL, transfer_reader, (pthread_addr_t)fdin);
                                                             ^
   transfer_test.c:179:58: error: cast to pointer from integer of different size [-Werror=int-to-pointer-cast]
      ret = pthread_create(&writerid, NULL, transfer_writer, (pthread_addr_t)fdout);
                                                             ^
   transfer_test.c:202:13: error: cast from pointer to integer of different size [-Werror=pointer-to-int-cast]
          ret = (int)value;
                ^
   transfer_test.c:216:13: error: cast from pointer to integer of different size [-Werror=pointer-to-int-cast]
          tmp = (int)value;
                ^
   
   Signed-off-by: nietingting <ni...@xiaomi.com>
   
   ## Impact
   no
   ## Testing
   test on local 
   


-- 
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] [incubator-nuttx-apps] pkarashchenko commented on a diff in pull request #1344: examples: clean warning of pipe

Posted by GitBox <gi...@apache.org>.
pkarashchenko commented on code in PR #1344:
URL: https://github.com/apache/incubator-nuttx-apps/pull/1344#discussion_r992100633


##########
examples/pipe/interlock_test.c:
##########
@@ -86,10 +89,12 @@ static void *null_writer(pthread_addr_t pvarg)
     {
       fprintf(stderr, "null_writer: close failed: %d\n", errno);
     }
+
   sleep(5);
 
   printf("null_writer: Returning success\n");
-  return (void*)0;
+  p = (void *) 0;

Review Comment:
   ```suggestion
     p = (void *)0;
   ```
   



##########
examples/pipe/interlock_test.c:
##########
@@ -177,21 +194,24 @@ int interlock_test(void)
   ret = pthread_join(writerid, &value);
   if (ret != 0)
     {
-      fprintf(stderr, "interlock_test: pthread_join failed, error=%d\n", ret);
+      fprintf(stderr, \
+        "interlock_test: pthread_join failed, error=%d\n", ret);
       ret = 6;
       goto errout_with_fifo;
     }
   else
     {
-      printf("interlock_test: writer returned %d\n", (int)value);
-      if (value != (void*)0)
+      printf("interlock_test: writer returned %p\n", value);
+      p = (void *) 0;

Review Comment:
   ```suggestion
         p = (void *)0;
   ```
   



##########
examples/pipe/interlock_test.c:
##########
@@ -69,9 +70,11 @@ static void *null_writer(pthread_addr_t pvarg)
   fd = open(FIFO_PATH2, O_WRONLY);
   if (fd < 0)
     {
-      fprintf(stderr, "null_writer: Failed to open FIFO %s for writing, errno=%d\n",
+      fprintf(stderr, \
+        "null_writer: Failed to open FIFO %s for writing, errno=%d\n",
               FIFO_PATH2, errno);
-      return (void*)1;
+      p = (void *) 1;

Review Comment:
   ```suggestion
         p = (void *)1;
   ```
   



-- 
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] [incubator-nuttx-apps] xiaoxiang781216 commented on a diff in pull request #1344: examples: clean warning of pipe

Posted by GitBox <gi...@apache.org>.
xiaoxiang781216 commented on code in PR #1344:
URL: https://github.com/apache/incubator-nuttx-apps/pull/1344#discussion_r992105881


##########
examples/pipe/interlock_test.c:
##########
@@ -177,21 +194,24 @@ int interlock_test(void)
   ret = pthread_join(writerid, &value);
   if (ret != 0)
     {
-      fprintf(stderr, "interlock_test: pthread_join failed, error=%d\n", ret);
+      fprintf(stderr, \
+        "interlock_test: pthread_join failed, error=%d\n", ret);
       ret = 6;
       goto errout_with_fifo;
     }
   else
     {
-      printf("interlock_test: writer returned %d\n", (int)value);
-      if (value != (void*)0)
+      printf("interlock_test: writer returned %p\n", value);
+      p = (void *) 0;

Review Comment:
   Fixed in https://github.com/apache/incubator-nuttx-apps/pull/1340



##########
examples/pipe/interlock_test.c:
##########
@@ -86,10 +89,12 @@ static void *null_writer(pthread_addr_t pvarg)
     {
       fprintf(stderr, "null_writer: close failed: %d\n", errno);
     }
+
   sleep(5);
 
   printf("null_writer: Returning success\n");
-  return (void*)0;
+  p = (void *) 0;

Review Comment:
   ditto



##########
examples/pipe/interlock_test.c:
##########
@@ -69,9 +70,11 @@ static void *null_writer(pthread_addr_t pvarg)
   fd = open(FIFO_PATH2, O_WRONLY);
   if (fd < 0)
     {
-      fprintf(stderr, "null_writer: Failed to open FIFO %s for writing, errno=%d\n",
+      fprintf(stderr, \
+        "null_writer: Failed to open FIFO %s for writing, errno=%d\n",
               FIFO_PATH2, errno);
-      return (void*)1;
+      p = (void *) 1;

Review Comment:
   ditto



-- 
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] [incubator-nuttx-apps] pkarashchenko commented on pull request #1344: examples: clean warning of pipe

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

   Oah, seems that is an apps side PR


-- 
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] [incubator-nuttx-apps] xiaoxiang781216 merged pull request #1344: examples: clean warning of pipe

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


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