All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] fdtdump: fix -Werror=int-to-pointer-cast
@ 2021-08-25 12:13 marcandre.lureau-H+wXaHxf7aLQT0dZR+AlfA
       [not found] ` <20210825121350.213551-1-marcandre.lureau-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
  0 siblings, 1 reply; 3+ messages in thread
From: marcandre.lureau-H+wXaHxf7aLQT0dZR+AlfA @ 2021-08-25 12:13 UTC (permalink / raw)
  To: devicetree-compiler-u79uwXL29TY76Z2rM5mHXA
  Cc: david-xT8FGy+AXnRB3Ne2BGzF6laj5H9X9Tb+, Marc-André Lureau

From: Marc-André Lureau <marcandre.lureau-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>

With mingw64-gcc, the compiler complains with various warnings:
error: cast from pointer to integer of different size [-Werror=pointer-to-int-cast]

Signed-off-by: Marc-André Lureau <marcandre.lureau-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
---
 fdtdump.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/fdtdump.c b/fdtdump.c
index bdc0f94..d424869 100644
--- a/fdtdump.c
+++ b/fdtdump.c
@@ -21,7 +21,7 @@
 #define MAX_VERSION 17U
 
 #define ALIGN(x, a)	(((x) + ((a) - 1)) & ~((a) - 1))
-#define PALIGN(p, a)	((void *)(ALIGN((unsigned long)(p), (a))))
+#define PALIGN(p, a)	((void *)(ALIGN((uintptr_t)(p), (a))))
 #define GET_CELL(p)	(p += 4, *((const fdt32_t *)(p-4)))
 
 static const char *tagname(uint32_t tag)
-- 
2.33.0.rc2


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

* Re: [PATCH] fdtdump: fix -Werror=int-to-pointer-cast
       [not found] ` <20210825121350.213551-1-marcandre.lureau-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
@ 2021-08-25 15:14   ` Rob Herring
  2021-08-26  0:58   ` David Gibson
  1 sibling, 0 replies; 3+ messages in thread
From: Rob Herring @ 2021-08-25 15:14 UTC (permalink / raw)
  To: Marc-André Lureau; +Cc: Devicetree Compiler, David Gibson

On Wed, Aug 25, 2021 at 7:14 AM <marcandre.lureau-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org> wrote:
>
> From: Marc-André Lureau <marcandre.lureau-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
>
> With mingw64-gcc, the compiler complains with various warnings:
> error: cast from pointer to integer of different size [-Werror=pointer-to-int-cast]

Perhaps also turn the warning on for all builds so we don't need
specific compilers to find warnings. Though maybe some compiler
versions don't support it?

>
> Signed-off-by: Marc-André Lureau <marcandre.lureau-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
> ---
>  fdtdump.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)

Acked-by: Rob Herring <robh-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>

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

* Re: [PATCH] fdtdump: fix -Werror=int-to-pointer-cast
       [not found] ` <20210825121350.213551-1-marcandre.lureau-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
  2021-08-25 15:14   ` Rob Herring
@ 2021-08-26  0:58   ` David Gibson
  1 sibling, 0 replies; 3+ messages in thread
From: David Gibson @ 2021-08-26  0:58 UTC (permalink / raw)
  To: marcandre.lureau-H+wXaHxf7aLQT0dZR+AlfA
  Cc: devicetree-compiler-u79uwXL29TY76Z2rM5mHXA

[-- Attachment #1: Type: text/plain, Size: 1212 bytes --]

On Wed, Aug 25, 2021 at 04:13:50PM +0400, marcandre.lureau-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org wrote:
> From: Marc-André Lureau <marcandre.lureau-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
> 
> With mingw64-gcc, the compiler complains with various warnings:
> error: cast from pointer to integer of different size [-Werror=pointer-to-int-cast]
> 
> Signed-off-by: Marc-André Lureau <marcandre.lureau-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>

Applied, thanks.

> ---
>  fdtdump.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/fdtdump.c b/fdtdump.c
> index bdc0f94..d424869 100644
> --- a/fdtdump.c
> +++ b/fdtdump.c
> @@ -21,7 +21,7 @@
>  #define MAX_VERSION 17U
>  
>  #define ALIGN(x, a)	(((x) + ((a) - 1)) & ~((a) - 1))
> -#define PALIGN(p, a)	((void *)(ALIGN((unsigned long)(p), (a))))
> +#define PALIGN(p, a)	((void *)(ALIGN((uintptr_t)(p), (a))))
>  #define GET_CELL(p)	(p += 4, *((const fdt32_t *)(p-4)))
>  
>  static const char *tagname(uint32_t tag)

-- 
David Gibson			| I'll have my music baroque, and my code
david AT gibson.dropbear.id.au	| minimalist, thank you.  NOT _the_ _other_
				| _way_ _around_!
http://www.ozlabs.org/~dgibson

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

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

end of thread, other threads:[~2021-08-26  0:58 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-08-25 12:13 [PATCH] fdtdump: fix -Werror=int-to-pointer-cast marcandre.lureau-H+wXaHxf7aLQT0dZR+AlfA
     [not found] ` <20210825121350.213551-1-marcandre.lureau-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
2021-08-25 15:14   ` Rob Herring
2021-08-26  0:58   ` David Gibson

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.