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 2021/10/30 14:03:12 UTC

[GitHub] [incubator-nuttx-apps] xiaoxiang781216 opened a new pull request #872: testing/ostest: Fix the compiler warning

xiaoxiang781216 opened a new pull request #872:
URL: https://github.com/apache/incubator-nuttx-apps/pull/872


   ## Summary
   ```
   aio.c: In function ‘check_done’:
   aio.c:158:41: warning: format ‘%d’ expects argument of type ‘int’, but argument 3 has type ‘ssize_t’ {aka ‘volatile long int’} [-Wformat=]
     158 |           printf("  list[%d]. result = %d\n", i, aiocbp->aio_result);
         |                                        ~^        ~~~~~~~~~~~~~~~~~~
         |                                         |              |
         |                                         int            ssize_t {aka volatile long int}
         |                                        %ld
   aio.c: In function ‘remove_done’:
   aio.c:222:41: warning: format ‘%d’ expects argument of type ‘int’, but argument 3 has type ‘ssize_t’ {aka ‘volatile long int’} [-Wformat=]
     222 |           printf("  list[%d]. result = %d\n", i, aiocbp->aio_result);
         |                                        ~^        ~~~~~~~~~~~~~~~~~~
         |                                         |              |
         |                                         int            ssize_t {aka volatile long int}
         |                                        %ld
   
   sporadic2.c: In function ‘sporadic2_test’:
   sporadic2.c:313:10: warning: format ‘%i’ expects argument of type ‘int’, but argument 4 has type ‘long int’ [-Wformat=]
     313 |   printf("Sporadic 1: prio high %d, low %d, repl %" PRIi32 " ns\n",
         |          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   In file included from /home/xiaoxiang/backup/os/nuttx/nuttx/include/stdint.h:35,
                    from /home/xiaoxiang/backup/os/nuttx/nuttx/include/sys/types.h:32,
                    from /home/xiaoxiang/backup/os/nuttx/nuttx/include/stdio.h:30,
                    from sporadic2.c:27:
   /home/xiaoxiang/backup/os/nuttx/nuttx/include/arch/inttypes.h:51:24: note: format string is defined here
      51 | #  define PRIi32      "i"
   sporadic2.c:315:10: warning: format ‘%i’ expects argument of type ‘int’, but argument 4 has type ‘long int’ [-Wformat=]
     315 |   printf("Sporadic 2: prio high %d, low %d, repl %" PRIi32 " ns\n",
         |          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   ```
   
   ## Impact
   Minor
   
   ## Testing
   sim:ostest
   


-- 
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 pull request #872: testing/ostest: Fix the compiler warning

Posted by GitBox <gi...@apache.org>.
xiaoxiang781216 commented on pull request #872:
URL: https://github.com/apache/incubator-nuttx-apps/pull/872#issuecomment-955714140


   @gustavonihei CI break is fixed by: https://github.com/apache/incubator-nuttx/pull/4751


-- 
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 change in pull request #872: testing/ostest: Fix the compiler warning

Posted by GitBox <gi...@apache.org>.
xiaoxiang781216 commented on a change in pull request #872:
URL: https://github.com/apache/incubator-nuttx-apps/pull/872#discussion_r739811584



##########
File path: testing/ostest/sporadic2.c
##########
@@ -310,9 +310,9 @@ int sporadic2_test(void)
   int32_t budget_2_ns = 30 * 1000000;
   int i;
 
-  printf("Sporadic 1: prio high %d, low %d, repl %" PRIi32 " ns\n",
+  printf("Sporadic 1: prio high %d, low %d, repl %ld ns\n",

Review comment:
       Done.




-- 
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] gustavonihei commented on a change in pull request #872: testing/ostest: Fix the compiler warning

Posted by GitBox <gi...@apache.org>.
gustavonihei commented on a change in pull request #872:
URL: https://github.com/apache/incubator-nuttx-apps/pull/872#discussion_r739805794



##########
File path: testing/ostest/sporadic2.c
##########
@@ -310,9 +310,9 @@ int sporadic2_test(void)
   int32_t budget_2_ns = 30 * 1000000;
   int i;
 
-  printf("Sporadic 1: prio high %d, low %d, repl %" PRIi32 " ns\n",
+  printf("Sporadic 1: prio high %d, low %d, repl %ld ns\n",

Review comment:
       How about changing the definition of REPL_INTERVAL to:
   ```patch
   --- a/testing/ostest/sporadic2.c
   +++ b/testing/ostest/sporadic2.c
   @@ -44,7 +44,7 @@
    #define PRIO_MID      100
    #define PRIO_HIGH1    180
    #define PRIO_HIGH2    170
   -#define REPL_INTERVAL 100000000L
   +#define REPL_INTERVAL INT32_C(100000000)
    #define MAX_BUDGET    (REPL_INTERVAL / 2)
    #define PRIO_HI_NDX   0
    #define PRIO_LO_NDX   1
    ```
   Then we may keep the format specifier as it currently is.




-- 
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] gustavonihei commented on a change in pull request #872: testing/ostest: Fix the compiler warning

Posted by GitBox <gi...@apache.org>.
gustavonihei commented on a change in pull request #872:
URL: https://github.com/apache/incubator-nuttx-apps/pull/872#discussion_r739804985



##########
File path: testing/ostest/aio.c
##########
@@ -155,7 +155,7 @@ static int check_done(void)
         {
           /* Check if the I/O has completed */
 
-          printf("  list[%d]. result = %d\n", i, aiocbp->aio_result);
+          printf("  list[%d]. result = %ld\n", i, aiocbp->aio_result);

Review comment:
       ```suggestion
             printf("  list[%d]. result = %zd\n", i, aiocbp->aio_result);
   ```
   `aio_result` type is `ssize_t`, so I think `z` fits best here.




-- 
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] gustavonihei commented on a change in pull request #872: testing/ostest: Fix the compiler warning

Posted by GitBox <gi...@apache.org>.
gustavonihei commented on a change in pull request #872:
URL: https://github.com/apache/incubator-nuttx-apps/pull/872#discussion_r739805019



##########
File path: testing/ostest/aio.c
##########
@@ -219,7 +219,7 @@ static int remove_done(void)
         {
           /* Check if the I/O has completed */
 
-          printf("  list[%d]. result = %d\n", i, aiocbp->aio_result);
+          printf("  list[%d]. result = %ld\n", i, aiocbp->aio_result);

Review comment:
       ```suggestion
             printf("  list[%d]. result = %zd\n", i, aiocbp->aio_result);
   ```
   `aio_result` type is `ssize_t`, so I think `z` fits best here.




-- 
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 change in pull request #872: testing/ostest: Fix the compiler warning

Posted by GitBox <gi...@apache.org>.
xiaoxiang781216 commented on a change in pull request #872:
URL: https://github.com/apache/incubator-nuttx-apps/pull/872#discussion_r739811534



##########
File path: testing/ostest/aio.c
##########
@@ -155,7 +155,7 @@ static int check_done(void)
         {
           /* Check if the I/O has completed */
 
-          printf("  list[%d]. result = %d\n", i, aiocbp->aio_result);
+          printf("  list[%d]. result = %ld\n", i, aiocbp->aio_result);

Review comment:
       Done.




-- 
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] gustavonihei merged pull request #872: testing/ostest: Fix the compiler warning

Posted by GitBox <gi...@apache.org>.
gustavonihei merged pull request #872:
URL: https://github.com/apache/incubator-nuttx-apps/pull/872


   


-- 
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 change in pull request #872: testing/ostest: Fix the compiler warning

Posted by GitBox <gi...@apache.org>.
xiaoxiang781216 commented on a change in pull request #872:
URL: https://github.com/apache/incubator-nuttx-apps/pull/872#discussion_r739811515



##########
File path: testing/ostest/aio.c
##########
@@ -219,7 +219,7 @@ static int remove_done(void)
         {
           /* Check if the I/O has completed */
 
-          printf("  list[%d]. result = %d\n", i, aiocbp->aio_result);
+          printf("  list[%d]. result = %ld\n", i, aiocbp->aio_result);

Review comment:
       Done.




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