linux-nfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [nfs-utils PATCH 1/2] nfsdcltrack/sqlite: Fix printf format
@ 2021-07-22 16:15 Petr Vorel
  2021-07-22 16:15 ` [nfs-utils PATCH 2/2] nfsdcltrack/nfsdcltrack.c: " Petr Vorel
  2021-07-26 16:31 ` [nfs-utils PATCH 1/2] nfsdcltrack/sqlite: " Steve Dickson
  0 siblings, 2 replies; 3+ messages in thread
From: Petr Vorel @ 2021-07-22 16:15 UTC (permalink / raw)
  To: linux-nfs; +Cc: Petr Vorel, Steve Dickson

sqlite.c: In function 'sqlite_remove_unreclaimed':
sqlite.c:547:71: error: format '%ld' expects argument of type 'long int', but argument 4 has type 'time_t' {aka 'long long int'} [-Werror=format=]
  547 |  ret = snprintf(buf, sizeof(buf), "DELETE FROM clients WHERE time < %ld",
      |                                                                     ~~^
      |                                                                       |
      |                                                                       long int
      |                                                                     %lld
  548 |    grace_start);
      |    ~~~~~~~~~~~
      |    |
      |    time_t {aka long long int}

Found in Buildroot riscv32 build.

Link: http://autobuild.buildroot.net/results/9bc1d43a588338b7395af7bc97535ee16a6ea2d9/build-end.log

Signed-off-by: Petr Vorel <petr.vorel@gmail.com>
---
 utils/nfsdcltrack/sqlite.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/utils/nfsdcltrack/sqlite.c b/utils/nfsdcltrack/sqlite.c
index f79aebb3..cea4a411 100644
--- a/utils/nfsdcltrack/sqlite.c
+++ b/utils/nfsdcltrack/sqlite.c
@@ -46,6 +46,7 @@
 #include <sys/stat.h>
 #include <sys/types.h>
 #include <fcntl.h>
+#include <inttypes.h>
 #include <unistd.h>
 #include <sqlite3.h>
 #include <linux/limits.h>
@@ -544,7 +545,7 @@ sqlite_remove_unreclaimed(time_t grace_start)
 	int ret;
 	char *err = NULL;
 
-	ret = snprintf(buf, sizeof(buf), "DELETE FROM clients WHERE time < %ld",
+	ret = snprintf(buf, sizeof(buf), "DELETE FROM clients WHERE time < %"PRIu64,
 			grace_start);
 	if (ret < 0) {
 		return ret;
-- 
2.32.0


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* [nfs-utils PATCH 2/2] nfsdcltrack/nfsdcltrack.c: Fix printf format
  2021-07-22 16:15 [nfs-utils PATCH 1/2] nfsdcltrack/sqlite: Fix printf format Petr Vorel
@ 2021-07-22 16:15 ` Petr Vorel
  2021-07-26 16:31 ` [nfs-utils PATCH 1/2] nfsdcltrack/sqlite: " Steve Dickson
  1 sibling, 0 replies; 3+ messages in thread
From: Petr Vorel @ 2021-07-22 16:15 UTC (permalink / raw)
  To: linux-nfs; +Cc: Petr Vorel, Steve Dickson

nfsdcltrack.c: In function 'cltrack_gracedone':
nfsdcltrack.c:528:47: error: format '%ld' expects argument of type 'long int', but argument 4 has type 'time_t' {aka 'long long int'} [-Werror=format=]
  528 |  xlog(D_GENERAL, "%s: grace done. gracetime=%ld", __func__, gracetime);
      |                                             ~~^             ~~~~~~~~~
      |                                               |             |
      |                                               long int      time_t {aka long long int}
      |                                             %lld

Found in Buildroot riscv32 build.

Link: http://autobuild.buildroot.net/results/9bc1d43a588338b7395af7bc97535ee16a6ea2d9/build-end.log

Signed-off-by: Petr Vorel <petr.vorel@gmail.com>
---
 utils/nfsdcltrack/nfsdcltrack.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/utils/nfsdcltrack/nfsdcltrack.c b/utils/nfsdcltrack/nfsdcltrack.c
index e926f1c0..0b37c094 100644
--- a/utils/nfsdcltrack/nfsdcltrack.c
+++ b/utils/nfsdcltrack/nfsdcltrack.c
@@ -33,6 +33,7 @@
 #include <sys/stat.h>
 #include <sys/types.h>
 #include <fcntl.h>
+#include <inttypes.h>
 #include <unistd.h>
 #include <libgen.h>
 #include <sys/inotify.h>
@@ -525,7 +526,7 @@ cltrack_gracedone(const char *timestr)
 	if (*tail)
 		return -EINVAL;
 
-	xlog(D_GENERAL, "%s: grace done. gracetime=%ld", __func__, gracetime);
+	xlog(D_GENERAL, "%s: grace done. gracetime=%"PRIu64, __func__, gracetime);
 
 	ret = sqlite_remove_unreclaimed(gracetime);
 
-- 
2.32.0


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [nfs-utils PATCH 1/2] nfsdcltrack/sqlite: Fix printf format
  2021-07-22 16:15 [nfs-utils PATCH 1/2] nfsdcltrack/sqlite: Fix printf format Petr Vorel
  2021-07-22 16:15 ` [nfs-utils PATCH 2/2] nfsdcltrack/nfsdcltrack.c: " Petr Vorel
@ 2021-07-26 16:31 ` Steve Dickson
  1 sibling, 0 replies; 3+ messages in thread
From: Steve Dickson @ 2021-07-26 16:31 UTC (permalink / raw)
  To: Petr Vorel, linux-nfs



On 7/22/21 12:15 PM, Petr Vorel wrote:
> sqlite.c: In function 'sqlite_remove_unreclaimed':
> sqlite.c:547:71: error: format '%ld' expects argument of type 'long int', but argument 4 has type 'time_t' {aka 'long long int'} [-Werror=format=]
>    547 |  ret = snprintf(buf, sizeof(buf), "DELETE FROM clients WHERE time < %ld",
>        |                                                                     ~~^
>        |                                                                       |
>        |                                                                       long int
>        |                                                                     %lld
>    548 |    grace_start);
>        |    ~~~~~~~~~~~
>        |    |
>        |    time_t {aka long long int}
> 
> Found in Buildroot riscv32 build.
> 
> Link: http://autobuild.buildroot.net/results/9bc1d43a588338b7395af7bc97535ee16a6ea2d9/build-end.log
> 
> Signed-off-by: Petr Vorel <petr.vorel@gmail.com>
Both Committed... (tag: nfs-utils-2-5-5-rc1)

steved
> ---
>   utils/nfsdcltrack/sqlite.c | 3 ++-
>   1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/utils/nfsdcltrack/sqlite.c b/utils/nfsdcltrack/sqlite.c
> index f79aebb3..cea4a411 100644
> --- a/utils/nfsdcltrack/sqlite.c
> +++ b/utils/nfsdcltrack/sqlite.c
> @@ -46,6 +46,7 @@
>   #include <sys/stat.h>
>   #include <sys/types.h>
>   #include <fcntl.h>
> +#include <inttypes.h>
>   #include <unistd.h>
>   #include <sqlite3.h>
>   #include <linux/limits.h>
> @@ -544,7 +545,7 @@ sqlite_remove_unreclaimed(time_t grace_start)
>   	int ret;
>   	char *err = NULL;
>   
> -	ret = snprintf(buf, sizeof(buf), "DELETE FROM clients WHERE time < %ld",
> +	ret = snprintf(buf, sizeof(buf), "DELETE FROM clients WHERE time < %"PRIu64,
>   			grace_start);
>   	if (ret < 0) {
>   		return ret;
> 


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2021-07-26 16:31 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-07-22 16:15 [nfs-utils PATCH 1/2] nfsdcltrack/sqlite: Fix printf format Petr Vorel
2021-07-22 16:15 ` [nfs-utils PATCH 2/2] nfsdcltrack/nfsdcltrack.c: " Petr Vorel
2021-07-26 16:31 ` [nfs-utils PATCH 1/2] nfsdcltrack/sqlite: " Steve Dickson

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).