You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nuttx.apache.org by xi...@apache.org on 2021/03/22 03:52:54 UTC
[incubator-nuttx-apps] 01/02: examples/qencoder/qe_main.c: Fix
printf() format specifier
This is an automated email from the ASF dual-hosted git repository.
xiaoxiang pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-nuttx-apps.git
commit 331fd61115bfad22ff839b19b2769d25da604a86
Author: Nathan Hartman <59...@users.noreply.github.com>
AuthorDate: Fri Mar 19 16:05:53 2021 -0400
examples/qencoder/qe_main.c: Fix printf() format specifier
examples/qencoder/qe_main.c:
* main(): Call to printf() had "%d" but argument was
int32_t, leading to compiler warning. Change format
specifier to PRIi32 (suggested by Gregory Nutt).
---
examples/qencoder/qe_main.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/examples/qencoder/qe_main.c b/examples/qencoder/qe_main.c
index e7bd5ca..8306a4d 100644
--- a/examples/qencoder/qe_main.c
+++ b/examples/qencoder/qe_main.c
@@ -48,6 +48,7 @@
#include <string.h>
#include <fcntl.h>
#include <limits.h>
+#include <inttypes.h>
#include <errno.h>
#include <debug.h>
@@ -300,7 +301,7 @@ int main(int argc, FAR char *argv[])
else
{
- printf("qe_main: %3d. %d\n", nloops+1, position);
+ printf("qe_main: %3d. %" PRIi32 "\n", nloops + 1, position);
}
/* Delay a little bit */