You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nuttx.apache.org by pk...@apache.org on 2022/10/31 10:21:02 UTC
[incubator-nuttx] branch master updated: Fix the format string mismatch warning
This is an automated email from the ASF dual-hosted git repository.
pkarashchenko pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-nuttx.git
The following commit(s) were added to refs/heads/master by this push:
new 3e3364d1a9 Fix the format string mismatch warning
3e3364d1a9 is described below
commit 3e3364d1a924f29aee26898eae20e60f9378332d
Author: Xiang Xiao <xi...@xiaomi.com>
AuthorDate: Mon Oct 31 00:10:24 2022 +0800
Fix the format string mismatch warning
Signed-off-by: Xiang Xiao <xi...@xiaomi.com>
---
arch/arm/src/cxd56xx/cxd56_timer.c | 4 ++--
libs/libc/machine/arm/armv6-m/arch_elf.c | 4 ++--
libs/libc/machine/arm/armv7-a/arch_elf.c | 10 +++++-----
libs/libc/machine/arm/armv7-m/arch_elf.c | 16 ++++++++--------
libs/libc/machine/arm/armv8-m/arch_elf.c | 16 ++++++++--------
5 files changed, 25 insertions(+), 25 deletions(-)
diff --git a/arch/arm/src/cxd56xx/cxd56_timer.c b/arch/arm/src/cxd56xx/cxd56_timer.c
index 4369b5d2d5..9c93907c9a 100644
--- a/arch/arm/src/cxd56xx/cxd56_timer.c
+++ b/arch/arm/src/cxd56xx/cxd56_timer.c
@@ -379,8 +379,8 @@ static int cxd56_settimeout(struct timer_lowerhalf_s *lower,
if (timeout < 1 || timeout > TIMER_MAXTIMEOUT)
{
- tmrerr("ERROR: Cannot represent timeout=%lu > %lu\n", timeout,
- TIMER_MAXTIMEOUT);
+ tmrerr("ERROR: Cannot represent timeout=%" PRIu32 " > %lu\n",
+ timeout, TIMER_MAXTIMEOUT);
return -ERANGE;
}
diff --git a/libs/libc/machine/arm/armv6-m/arch_elf.c b/libs/libc/machine/arm/armv6-m/arch_elf.c
index 3bdad9d599..60001cbf85 100644
--- a/libs/libc/machine/arm/armv6-m/arch_elf.c
+++ b/libs/libc/machine/arm/armv6-m/arch_elf.c
@@ -423,8 +423,8 @@ int up_relocate(const Elf32_Rel *rel, const Elf32_Sym *sym, uintptr_t addr)
/* And perform the relocation */
- binfo(" offset=%08lx branch target=%08lx\n",
- (long)offset, offset + sym->st_value);
+ binfo(" offset=%08" PRIx32 " branch target=%08" PRIx32 "\n",
+ offset, offset + sym->st_value);
offset += sym->st_value;
diff --git a/libs/libc/machine/arm/armv7-a/arch_elf.c b/libs/libc/machine/arm/armv7-a/arch_elf.c
index a8f7ac3367..1ecacf3de7 100644
--- a/libs/libc/machine/arm/armv7-a/arch_elf.c
+++ b/libs/libc/machine/arm/armv7-a/arch_elf.c
@@ -307,8 +307,8 @@ int up_relocate(const Elf32_Rel *rel, const Elf32_Sym *sym, uintptr_t addr)
/* And perform the relocation */
- binfo(" offset=%08lx branch target=%08lx\n",
- (long)offset, offset + sym->st_value);
+ binfo(" offset=%08" PRIx32 " branch target=%08" PRIx32 "\n",
+ offset, offset + sym->st_value);
offset += sym->st_value;
@@ -413,7 +413,7 @@ int up_relocate(const Elf32_Rel *rel, const Elf32_Sym *sym, uintptr_t addr)
/* And perform the relocation */
binfo(" S=%" PRId32 " J1=%" PRId32 " J2=%" PRId32
- " offset=%08" PRIx32 " branch target=%08lx\n",
+ " offset=%08" PRIx32 " branch target=%08" PRIx32 "\n",
S, J1, J2, offset, offset + sym->st_value - addr);
offset += sym->st_value - addr;
@@ -425,7 +425,7 @@ int up_relocate(const Elf32_Rel *rel, const Elf32_Sym *sym, uintptr_t addr)
if (ELF32_ST_TYPE(sym->st_info) == STT_FUNC && (offset & 1) == 0)
{
berr("ERROR: ERROR: JUMP24 [%" PRId32 "] "
- "requires odd offset, offset=%08lx\n",
+ "requires odd offset, offset=%08" PRIx32 "\n",
ELF32_R_TYPE(rel->r_info), offset);
return -EINVAL;
@@ -436,7 +436,7 @@ int up_relocate(const Elf32_Rel *rel, const Elf32_Sym *sym, uintptr_t addr)
if (offset < (int32_t)0xff000000 || offset >= (int32_t)0x01000000)
{
berr("ERROR: ERROR: JUMP24 [%" PRId32 "] "
- "relocation out of range, branch target=%08lx\n",
+ "relocation out of range, branch target=%08" PRIx32 "\n",
ELF32_R_TYPE(rel->r_info), offset);
return -EINVAL;
diff --git a/libs/libc/machine/arm/armv7-m/arch_elf.c b/libs/libc/machine/arm/armv7-m/arch_elf.c
index cbf454d38c..c2e6c27056 100644
--- a/libs/libc/machine/arm/armv7-m/arch_elf.c
+++ b/libs/libc/machine/arm/armv7-m/arch_elf.c
@@ -159,7 +159,7 @@ int up_relocate(const Elf32_Rel *rel, const Elf32_Sym *sym, uintptr_t addr)
offset >= (int32_t) 0x02000000)
{
berr("ERROR: ERROR: PC24 [%" PRId32 "] "
- "relocation out of range, offset=%08lx\n",
+ "relocation out of range, offset=%08" PRIx32 "\n",
ELF32_R_TYPE(rel->r_info), offset);
return -EINVAL;
@@ -276,7 +276,7 @@ int up_relocate(const Elf32_Rel *rel, const Elf32_Sym *sym, uintptr_t addr)
/* And perform the relocation */
binfo(" S=%" PRId32 " J1=%" PRId32 " J2=%" PRId32
- " offset=%08" PRIx32 " branch target=%08lx\n",
+ " offset=%08" PRIx32 " branch target=%08" PRIx32 "\n",
S, J1, J2, offset, offset + sym->st_value - addr);
offset += sym->st_value - addr;
@@ -288,7 +288,7 @@ int up_relocate(const Elf32_Rel *rel, const Elf32_Sym *sym, uintptr_t addr)
if (ELF32_ST_TYPE(sym->st_info) == STT_FUNC && (offset & 1) == 0)
{
berr("ERROR: ERROR: JUMP24 [%" PRId32 "] "
- "requires odd offset, offset=%08lx\n",
+ "requires odd offset, offset=%08" PRIx32 "\n",
ELF32_R_TYPE(rel->r_info), offset);
return -EINVAL;
@@ -299,7 +299,7 @@ int up_relocate(const Elf32_Rel *rel, const Elf32_Sym *sym, uintptr_t addr)
if (offset < (int32_t)0xff000000 || offset >= (int32_t)0x01000000)
{
berr("ERROR: ERROR: JUMP24 [%" PRId32 "] "
- "relocation out of range, branch target=%08lx\n",
+ "relocation out of range, branch target=%08" PRIx32 "\n",
ELF32_R_TYPE(rel->r_info), offset);
return -EINVAL;
@@ -428,8 +428,8 @@ int up_relocate(const Elf32_Rel *rel, const Elf32_Sym *sym, uintptr_t addr)
/* And perform the relocation */
- binfo(" offset=%08lx branch target=%08lx\n",
- (long)offset, offset + sym->st_value);
+ binfo(" offset=%08" PRIx32 " branch target=%08" PRIx32 "\n",
+ offset, offset + sym->st_value);
offset += sym->st_value;
@@ -469,7 +469,7 @@ int up_relocate(const Elf32_Rel *rel, const Elf32_Sym *sym, uintptr_t addr)
if (ELF32_ST_TYPE(sym->st_info) == STT_FUNC && (offset & 1) == 0)
{
berr("ERROR: JUMP11 [%" PRId32 "] "
- "requires odd offset, offset=%08lx\n",
+ "requires odd offset, offset=%08" PRIx32 "\n",
ELF32_R_TYPE(rel->r_info), offset);
return -EINVAL;
@@ -480,7 +480,7 @@ int up_relocate(const Elf32_Rel *rel, const Elf32_Sym *sym, uintptr_t addr)
if (offset < (int32_t)0xfffff800 || offset >= (int32_t)0x0800)
{
berr("ERROR: JUMP11 [%" PRId32 "] "
- "relocation out of range, branch target=%08lx\n",
+ "relocation out of range, branch target=%08" PRIx32 "\n",
ELF32_R_TYPE(rel->r_info), offset);
return -EINVAL;
diff --git a/libs/libc/machine/arm/armv8-m/arch_elf.c b/libs/libc/machine/arm/armv8-m/arch_elf.c
index 2d2572e7bb..d63e5edc7d 100644
--- a/libs/libc/machine/arm/armv8-m/arch_elf.c
+++ b/libs/libc/machine/arm/armv8-m/arch_elf.c
@@ -159,7 +159,7 @@ int up_relocate(const Elf32_Rel *rel, const Elf32_Sym *sym, uintptr_t addr)
offset >= (int32_t) 0x02000000)
{
berr("ERROR: ERROR: PC24 [%" PRId32 "] "
- "relocation out of range, offset=%08lx\n",
+ "relocation out of range, offset=%08" PRIx32 "\n",
ELF32_R_TYPE(rel->r_info), offset);
return -EINVAL;
@@ -276,7 +276,7 @@ int up_relocate(const Elf32_Rel *rel, const Elf32_Sym *sym, uintptr_t addr)
/* And perform the relocation */
binfo(" S=%" PRId32 " J1=%" PRId32 " J2=%" PRId32
- " offset=%08" PRIx32 " branch target=%08lx\n",
+ " offset=%08" PRIx32 " branch target=%08" PRIx32 "\n",
S, J1, J2, offset, offset + sym->st_value - addr);
offset += sym->st_value - addr;
@@ -288,7 +288,7 @@ int up_relocate(const Elf32_Rel *rel, const Elf32_Sym *sym, uintptr_t addr)
if (ELF32_ST_TYPE(sym->st_info) == STT_FUNC && (offset & 1) == 0)
{
berr("ERROR: ERROR: JUMP24 [%" PRId32 "] "
- "requires odd offset, offset=%08lx\n",
+ "requires odd offset, offset=%08" PRIx32 "\n",
ELF32_R_TYPE(rel->r_info), offset);
return -EINVAL;
@@ -299,7 +299,7 @@ int up_relocate(const Elf32_Rel *rel, const Elf32_Sym *sym, uintptr_t addr)
if (offset < (int32_t)0xff000000 || offset >= (int32_t)0x01000000)
{
berr("ERROR: ERROR: JUMP24 [%" PRId32 "] "
- "relocation out of range, branch target=%08lx\n",
+ "relocation out of range, branch target=%08" PRIx32 "\n",
ELF32_R_TYPE(rel->r_info), offset);
return -EINVAL;
@@ -428,8 +428,8 @@ int up_relocate(const Elf32_Rel *rel, const Elf32_Sym *sym, uintptr_t addr)
/* And perform the relocation */
- binfo(" offset=%08lx branch target=%08lx\n",
- (long)offset, offset + sym->st_value);
+ binfo(" offset=%08" PRIx32 " branch target=%08" PRIx32 "\n",
+ offset, offset + sym->st_value);
offset += sym->st_value;
@@ -469,7 +469,7 @@ int up_relocate(const Elf32_Rel *rel, const Elf32_Sym *sym, uintptr_t addr)
if (ELF32_ST_TYPE(sym->st_info) == STT_FUNC && (offset & 1) == 0)
{
berr("ERROR: JUMP11 [%" PRId32 "] "
- "requires odd offset, offset=%08lx\n",
+ "requires odd offset, offset=%08" PRIx32 "\n",
ELF32_R_TYPE(rel->r_info), offset);
return -EINVAL;
@@ -480,7 +480,7 @@ int up_relocate(const Elf32_Rel *rel, const Elf32_Sym *sym, uintptr_t addr)
if (offset < (int32_t)0xfffff800 || offset >= (int32_t)0x0800)
{
berr("ERROR: JUMP11 [%" PRId32 "] "
- "relocation out of range, branch target=%08lx\n",
+ "relocation out of range, branch target=%08" PRIx32 "\n",
ELF32_R_TYPE(rel->r_info), offset);
return -EINVAL;