Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1545624

Re: [PATCH] openrisc: Define __kernel_size_t to suppress compiler warnings

From Geert Uytterhoeven <geert@linux-m68k.org>
Newsgroups linux.kernel
Subject Re: [PATCH] openrisc: Define __kernel_size_t to suppress compiler warnings
Date 2016-12-21 08:10 +0100
Message-ID <sQJcd-eY-5@gated-at.bofh.it> (permalink)
References <sQth7-6Ck-15@gated-at.bofh.it> <sQzcR-1Vi-15@gated-at.bofh.it> <sQzwe-22b-11@gated-at.bofh.it> <sQBol-3lH-3@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


On Tue, Dec 20, 2016 at 11:44 PM, Andreas Schwab <schwab@linux-m68k.org> wrote:
> On Dez 20 2016, Geert Uytterhoeven <geert@linux-m68k.org> wrote:
>> When I saw this patch, I was already a bit skeptical about it, but I noticed
>> other architectures (e.g. avr32) are doing the same, so I didn't reply.
>>
>> In my experience, "format '%zu' expects argument of type 'size_t', but
>> argument 3 has type 'unsigned int'" happens when using a compiler that
>> was not configured to use the correct type (should be unsigned long) for
>> size_t. Typically this happens when using a compiler not configured for
>> a Linux target.
>
> 32-bit targets typically use unsigned int for size_t.  It is part of the
> ABI, so all compilers must agree.  Since or32 is a out-of-tree port, and
> gcc defaults to unsigned long for size_t, mismatches can happen if
> people are using incomplete patches.

Right, thanks for correcting me!
It should indeed be unsigned int on 32-bit, and unsigned long on 64-bit.

Gr{oetje,eeting}s,

                        Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
                                -- Linus Torvalds

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCH] openrisc: Define __kernel_size_t to suppress compiler warnings Stafford Horne <shorne@gmail.com> - 2016-12-20 15:10 +0100
  Re: [PATCH] openrisc: Define __kernel_size_t to suppress compiler  warnings kbuild test robot <lkp@intel.com> - 2016-12-20 21:30 +0100
    Re: [PATCH] openrisc: Define __kernel_size_t to suppress compiler warnings Geert Uytterhoeven <geert@linux-m68k.org> - 2016-12-20 21:50 +0100
      Re: [PATCH] openrisc: Define __kernel_size_t to suppress compiler warnings Andreas Schwab <schwab@linux-m68k.org> - 2016-12-20 23:50 +0100
        Re: [PATCH] openrisc: Define __kernel_size_t to suppress compiler  warnings Stafford Horne <shorne@gmail.com> - 2016-12-21 00:10 +0100
        Re: [PATCH] openrisc: Define __kernel_size_t to suppress compiler warnings Geert Uytterhoeven <geert@linux-m68k.org> - 2016-12-21 08:10 +0100
  Re: [PATCH] openrisc: Define __kernel_size_t to suppress compiler  warnings kbuild test robot <lkp@intel.com> - 2016-12-21 05:10 +0100

csiph-web