From: Nobuhiro Iwamatsu Date: Mon, 1 Nov 2021 00:14:43 +0000 (+0900) Subject: [PATCH] Fix format of sprintf X-Git-Tag: archive/raspbian/2.5-5+rpi1~2 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=f31ec66fb592ed5a66ad33005f2856e8d19b595d;p=target-factory.git [PATCH] Fix format of sprintf https://buildd.debian.org/status/fetch.php?pkg=target-factory&arch=armel&ver=1.4-2&stamp=1635640153&raw=0 ``` <>/src/create_target_DPUCVDX8G_ISA1.cpp: In function ‘const vitis::ai::Target vitis::ai::create_target_DPUCVDX8G_ISA1(uint64_t)’: /<>/src/create_target_DPUCVDX8G_ISA1.cpp:61:29: error: format ‘%lX’ expects argument of type ‘long unsigned int’, but argument 3 has type ‘long long unsigned int’ [-Werror=format=] 61 | sprintf(finger_hex, "%016lX", fingerprint); | ~~~~~^ ~~~~~~~~~~~ | | | | | long long unsigned int | long unsigned int | %016llX ``` Signed-off-by: Nobuhiro Iwamatsu Gbp-Pq: Name 0004-Fix-format-of-sprintf.patch --- diff --git a/src/create_target_DPUCVDX8G_ISA0.cpp b/src/create_target_DPUCVDX8G_ISA0.cpp index 2ebaae0..d03647b 100644 --- a/src/create_target_DPUCVDX8G_ISA0.cpp +++ b/src/create_target_DPUCVDX8G_ISA0.cpp @@ -15,6 +15,7 @@ limitations under the License. */ #include "target.pb.h" +#include namespace vitis { namespace ai { @@ -59,7 +60,7 @@ const Target create_target_DPUCVDX8G_ISA0(const std::uint64_t fingerprint) { std::string NAME = "DPUCVDX8G_ISAx_CxBx_x"; char finger_hex[17]; - sprintf(finger_hex, "%016lX", fingerprint); + sprintf(finger_hex, "%016" PRIx64, fingerprint); NAME.replace(20, 1, finger_hex); NAME.replace(18, 1, std::to_string(BATCH)); NAME.replace(16, 1, std::to_string(OCP)); diff --git a/src/create_target_DPUCVDX8G_ISA1.cpp b/src/create_target_DPUCVDX8G_ISA1.cpp index 18b0850..106e83a 100644 --- a/src/create_target_DPUCVDX8G_ISA1.cpp +++ b/src/create_target_DPUCVDX8G_ISA1.cpp @@ -15,6 +15,7 @@ limitations under the License. */ #include "target.pb.h" +#include namespace vitis { namespace ai { @@ -58,7 +59,7 @@ const Target create_target_DPUCVDX8G_ISA1(const std::uint64_t fingerprint) { std::string NAME = "DPUCVDX8G_ISAx_CxBx_x"; char finger_hex[17]; - sprintf(finger_hex, "%016lX", fingerprint); + sprintf(finger_hex, "%016" PRIx64, fingerprint); NAME.replace(20, 1, finger_hex); NAME.replace(18, 1, std::to_string(BATCH)); NAME.replace(16, 1, std::to_string(OCP)); diff --git a/src/create_target_v2.cpp b/src/create_target_v2.cpp index 521e310..d62eb35 100644 --- a/src/create_target_v2.cpp +++ b/src/create_target_v2.cpp @@ -15,6 +15,7 @@ limitations under the License. */ #include "target.pb.h" +#include namespace vitis { namespace ai { @@ -54,7 +55,7 @@ const Target create_target_v2(const std::uint64_t fingerprint) { std::string NAME = "DPUCVDX8G_ISAx_Bx_x"; char finger_hex[17]; - sprintf(finger_hex, "%016lX", fingerprint); + sprintf(finger_hex, "%016" PRIx64, fingerprint); NAME.replace(18, 1, finger_hex); NAME.replace(16, 1, std::to_string(PEAK)); NAME.replace(13, 1, std::to_string(ISA));