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/02/28 19:14:21 UTC

[GitHub] [incubator-nuttx] fjpanag commented on pull request #2347: Enable format check for syslog

fjpanag commented on pull request #2347:
URL: https://github.com/apache/incubator-nuttx/pull/2347#issuecomment-787505848


   @yamt @xiaoxiang781216 
   
   This effectively broke NuttX for me.  
   After this I am no longer able to build NuttX with `-Wall -Werror`, as I was before.
   I get a bunch of similar errors:
   
   ```
   In file included from /path/to/nuttx/include/nuttx/mm/shm.h:30,
                    from /path/to/nuttx/include/nuttx/sched.h:41,
                    from /path/to/nuttx/include/sched.h:36,
                    from /path/to/nuttx/include/nuttx/arch.h:81,
                    from chip/stm32_wwdg.c:41:
   chip/stm32_wwdg.c: In function 'stm32_getstatus':
   chip/stm32_wwdg.c:474:10: error: format '%x' expects argument of type 'unsigned int', but argument 3 has type 'uint32_t' {aka 'long unsigned int'} [-Werror=format=]
     474 |   wdinfo("  flags    : %08x\n", status->flags);
         |          ^~~~~~~~~~~~~~~~~~~~~  ~~~~~~~~~~~~~
         |                                       |
         |                                       uint32_t {aka long unsigned int}
   chip/stm32_wwdg.c:474:27: note: format string is defined here
     474 |   wdinfo("  flags    : %08x\n", status->flags);
         |                        ~~~^
         |                           |
         |                           unsigned int
         |                        %08lx
   In file included from /path/to/nuttx/include/nuttx/mm/shm.h:30,
                    from /path/to/nuttx/include/nuttx/sched.h:41,
                    from /path/to/nuttx/include/sched.h:36,
                    from /path/to/nuttx/include/nuttx/arch.h:81,
                    from chip/stm32_wwdg.c:41:
   chip/stm32_wwdg.c:475:10: error: format '%d' expects argument of type 'int', but argument 3 has type 'uint32_t' {aka 'long unsigned int'} [-Werror=format=]
     475 |   wdinfo("  timeout  : %d\n", status->timeout);
         |          ^~~~~~~~~~~~~~~~~~~  ~~~~~~~~~~~~~~~
         |                                     |
         |                                     uint32_t {aka long unsigned int}
   chip/stm32_wwdg.c:475:25: note: format string is defined here
     475 |   wdinfo("  timeout  : %d\n", status->timeout);
         |                        ~^
         |                         |
         |                         int
         |                        %ld
   In file included from /path/to/nuttx/include/nuttx/mm/shm.h:30,
                    from /path/to/nuttx/include/nuttx/sched.h:41,
                    from /path/to/nuttx/include/sched.h:36,
                    from /path/to/nuttx/include/nuttx/arch.h:81,
                    from chip/stm32_wwdg.c:41:
   chip/stm32_wwdg.c:476:10: error: format '%d' expects argument of type 'int', but argument 3 has type 'uint32_t' {aka 'long unsigned int'} [-Werror=format=]
     476 |   wdinfo("  timeleft : %d\n", status->flags);
         |          ^~~~~~~~~~~~~~~~~~~  ~~~~~~~~~~~~~
         |                                     |
         |                                     uint32_t {aka long unsigned int}
   chip/stm32_wwdg.c:476:25: note: format string is defined here
     476 |   wdinfo("  timeleft : %d\n", status->flags);
         |                        ~^
         |                         |
         |                         int
         |                        %ld
   In file included from /path/to/nuttx/include/nuttx/mm/shm.h:30,
                    from /path/to/nuttx/include/nuttx/sched.h:41,
                    from /path/to/nuttx/include/sched.h:36,
                    from /path/to/nuttx/include/nuttx/arch.h:81,
                    from chip/stm32_wwdg.c:41:
   chip/stm32_wwdg.c: In function 'stm32_settimeout':
   CC:  pthread/pthread_mutextrylock.c
   chip/stm32_wwdg.c:506:10: error: format '%d' expects argument of type 'int', but argument 3 has type 'uint32_t' {aka 'long unsigned int'} [-Werror=format=]
     506 |   wdinfo("Entry: timeout=%d\n", timeout);
         |          ^~~~~~~~~~~~~~~~~~~~~  ~~~~~~~
         |                                 |
         |                                 uint32_t {aka long unsigned int}
   chip/stm32_wwdg.c:506:27: note: format string is defined here
     506 |   wdinfo("Entry: timeout=%d\n", timeout);
         |                          ~^
         |                           |
         |                           int
         |                          %ld
   In file included from /path/to/nuttx/include/nuttx/mm/shm.h:30,
                    from /path/to/nuttx/include/nuttx/sched.h:41,
                    from /path/to/nuttx/include/sched.h:36,
                    from /path/to/nuttx/include/nuttx/arch.h:81,
                    from chip/stm32_wwdg.c:41:
   chip/stm32_wwdg.c:512:13: error: format '%d' expects argument of type 'int', but argument 3 has type 'uint32_t' {aka 'long unsigned int'} [-Werror=format=]
     512 |       wderr("ERROR: Cannot represent timeout=%d > %d\n",
         |             ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
     513 |             timeout, WWDG_MAXTIMEOUT);
         |             ~~~~~~~
         |             |
         |             uint32_t {aka long unsigned int}
   chip/stm32_wwdg.c:512:47: note: format string is defined here
     512 |       wderr("ERROR: Cannot represent timeout=%d > %d\n",
         |                                              ~^
         |                                               |
         |                                               int
         |                                              %ld
   In file included from /path/to/nuttx/include/nuttx/mm/shm.h:30,
                    from /path/to/nuttx/include/nuttx/sched.h:41,
                    from /path/to/nuttx/include/sched.h:36,
                    from /path/to/nuttx/include/nuttx/arch.h:81,
                    from chip/stm32_wwdg.c:41:
   chip/stm32_wwdg.c:512:13: error: format '%d' expects argument of type 'int', but argument 4 has type 'long unsigned int' [-Werror=format=]
     512 |       wderr("ERROR: Cannot represent timeout=%d > %d\n",
         |             ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   chip/stm32_wwdg.c:512:52: note: format string is defined here
     512 |       wderr("ERROR: Cannot represent timeout=%d > %d\n",
         |                                                   ~^
         |                                                    |
         |                                                    int
         |                                                   %ld
   In file included from /path/to/nuttx/include/nuttx/mm/shm.h:30,
                    from /path/to/nuttx/include/nuttx/sched.h:41,
                    from /path/to/nuttx/include/sched.h:36,
                    from /path/to/nuttx/include/nuttx/arch.h:81,
                    from chip/stm32_wwdg.c:41:
   chip/stm32_wwdg.c:594:10: error: format '%d' expects argument of type 'int', but argument 4 has type 'uint32_t' {aka 'long unsigned int'} [-Werror=format=]
     594 |   wdinfo("wdgtb=%d fwwdg=%d reload=%d timeout=%d\n",
         |          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
     595 |          wdgtb, fwwdg, reload, priv->timeout);
         |                 ~~~~~
         |                 |
         |                 uint32_t {aka long unsigned int}
   chip/stm32_wwdg.c:594:27: note: format string is defined here
     594 |   wdinfo("wdgtb=%d fwwdg=%d reload=%d timeout=%d\n",
         |                          ~^
         |                           |
         |                           int
         |                          %ld
   In file included from /path/to/nuttx/include/nuttx/mm/shm.h:30,
                    from /path/to/nuttx/include/nuttx/sched.h:41,
                    from /path/to/nuttx/include/sched.h:36,
                    from /path/to/nuttx/include/nuttx/arch.h:81,
                    from chip/stm32_wwdg.c:41:
   chip/stm32_wwdg.c:594:10: error: format '%d' expects argument of type 'int', but argument 5 has type 'uint32_t' {aka 'long unsigned int'} [-Werror=format=]
     594 |   wdinfo("wdgtb=%d fwwdg=%d reload=%d timeout=%d\n",
         |          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
     595 |          wdgtb, fwwdg, reload, priv->timeout);
         |                        ~~~~~~
         |                        |
         |                        uint32_t {aka long unsigned int}
   chip/stm32_wwdg.c:594:37: note: format string is defined here
     594 |   wdinfo("wdgtb=%d fwwdg=%d reload=%d timeout=%d\n",
         |                                    ~^
         |                                     |
         |                                     int
         |                                    %ld
   In file included from /path/to/nuttx/include/nuttx/mm/shm.h:30,
                    from /path/to/nuttx/include/nuttx/sched.h:41,
                    from /path/to/nuttx/include/sched.h:36,
                    from /path/to/nuttx/include/nuttx/arch.h:81,
                    from chip/stm32_wwdg.c:41:
   chip/stm32_wwdg.c:594:10: error: format '%d' expects argument of type 'int', but argument 6 has type 'uint32_t' {aka 'long unsigned int'} [-Werror=format=]
     594 |   wdinfo("wdgtb=%d fwwdg=%d reload=%d timeout=%d\n",
         |          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
     595 |          wdgtb, fwwdg, reload, priv->timeout);
         |                                ~~~~~~~~~~~~~
         |                                    |
         |                                    uint32_t {aka long unsigned int}
   chip/stm32_wwdg.c:594:48: note: format string is defined here
     594 |   wdinfo("wdgtb=%d fwwdg=%d reload=%d timeout=%d\n",
         |                                               ~^
         |                                                |
         |                                                int
         |  
   ```


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

For queries about this service, please contact Infrastructure at:
users@infra.apache.org