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


Groups > linux.kernel > #1511483

Re: [PATCH] lpfc: use %zd format string for size_t

From Vineet Gupta <Vineet.Gupta1@synopsys.com>
Newsgroups linux.kernel
Subject Re: [PATCH] lpfc: use %zd format string for size_t
Date 2016-10-29 01:30 +0200
Message-ID <sxoKZ-6sr-9@gated-at.bofh.it> (permalink)
References <stfmV-3uj-15@gated-at.bofh.it> <sxnlU-5t8-19@gated-at.bofh.it> <sxnlU-5t8-21@gated-at.bofh.it> <sxnvA-5M1-27@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


On 10/28/2016 03:03 PM, Arnd Bergmann wrote:
> On Friday, October 28, 2016 2:58:33 PM CEST Vineet Gupta wrote:
>> On 10/28/2016 02:52 PM, Vineet Gupta wrote:
>>> On 10/28/2016 02:44 PM, Vineet Gupta wrote:
>>>> This is configuration specific, and something caused your compiler to
>>>>> be built assuming that size_t is unsigned long, while the kernel
>>>>> headers are assuming it should be unsigned int.
>>>
>>> So yes this seems to be target specific gcc thing
>>>
>>> for ARC 4.8
>>>
>>> #define PTRDIFF_TYPE "int"
>>>
>>> ARM
>>>
>>> #ifndef PTRDIFF_TYPE
>>> #define PTRDIFF_TYPE (TARGET_AAPCS_BASED ? "int" : "long int")
>>> #endif
>>>
>>> ARC gcc 6.2
>>>
>>> #undef PTRDIFF_TYPE
>>> #define PTRDIFF_TYPE "long int"
>>
>> Actually we need to adjust SIZE_TYPE (unsigned int) and PTRDIFF_TYPE (int) in the
>> gcc 6.x to fix this issue. And that is exactly what ARC gcc 4.8 have.
> 
> What compiler versions are most commonly used these days?

gcc 4.8 is used in production, but internally we are now moving towards 6.0 (to be
officially released soon)

> You should probably stay with the version that most people have
> and then update either the compiler or the kernel, whichever
> diverges from it.

In this case, the issue is simple - gcc 6.x doesn't behave the same as 4.8 so it
needs fixing.

> I see in the gcc git log that the version that had "int" got removed
> at some point, and the version that had "unsigned int" was added
> later.

The upstream version (per initial port) always had

#define SIZE_TYPE "long unsigned int"

which we fixed out-of-tree for 4.8 and this needs to be fixed now for gcc 6.x in
upstream too.

-Vineet

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


Thread

Re: [PATCH] lpfc: use %zd format string for size_t Vineet Gupta <Vineet.Gupta1@synopsys.com> - 2016-10-28 23:10 +0200
  Re: [PATCH] lpfc: use %zd format string for size_t Arnd Bergmann <arnd@arndb.de> - 2016-10-28 23:40 +0200
    Re: [PATCH] lpfc: use %zd format string for size_t Vineet Gupta <Vineet.Gupta1@synopsys.com> - 2016-10-28 23:50 +0200
      Re: [PATCH] lpfc: use %zd format string for size_t Arnd Bergmann <arnd@arndb.de> - 2016-10-29 00:00 +0200
      Re: [PATCH] lpfc: use %zd format string for size_t Vineet Gupta <Vineet.Gupta1@synopsys.com> - 2016-10-29 00:00 +0200
        Re: [PATCH] lpfc: use %zd format string for size_t Vineet Gupta <Vineet.Gupta1@synopsys.com> - 2016-10-29 00:00 +0200
          Re: [PATCH] lpfc: use %zd format string for size_t Arnd Bergmann <arnd@arndb.de> - 2016-10-29 00:10 +0200
            Re: [PATCH] lpfc: use %zd format string for size_t Vineet Gupta <Vineet.Gupta1@synopsys.com> - 2016-10-29 01:30 +0200

csiph-web