From 2993384c8f62e4d1cf4115cd245ea4fc3d464c48 Mon Sep 17 00:00:00 2001 From: Nobuhiro Iwamatsu Date: Mon, 1 Nov 2021 09:14:43 +0900 Subject: [PATCH] [PATCH] Fix format of sprintf MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit 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 --- src/create_target_DPUCVDX8G_ISA0.cpp | 3 ++- src/create_target_DPUCVDX8G_ISA1.cpp | 3 ++- src/create_target_v2.cpp | 3 ++- 3 files changed, 6 insertions(+), 3 deletions(-) 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)); -- 2.30.2