lkml.org 
[lkml]   [2012]   [Nov]   [29]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
SubjectRe: [PATCH, resend] kfifo: initialize fifo accordingly to C99 standard
From
On Thu, Nov 29, 2012 at 3:51 AM, Andrew Morton
<akpm@linux-foundation.org> wrote:
> On Wed, 21 Nov 2012 16:31:11 +0200
> Andy Shevchenko <andriy.shevchenko@linux.intel.com> wrote:
>
>> When build a kernel with "make W=1" we will get a warning about missing
>> initializer. It comes from kfifo usage style. The DEFINE_KFIFO macro doesn't
>> initialize the buf[] field of the fifo structure. So, using C99 style helps in
>> such case.
>
> This doesn't actually work:
>
> drivers/pci/pcie/aer/aerdrv_core.c:573: error: unknown field 'kfifo' specified in initializer
> drivers/pci/pcie/aer/aerdrv_core.c:573: error: unknown field 'in' specified in initializer
> drivers/pci/pcie/aer/aerdrv_core.c:573: warning: missing braces around initializer
> drivers/pci/pcie/aer/aerdrv_core.c:573: warning: (near initialization for '(anonymous).<anonymous>.kfifo')
> drivers/pci/pcie/aer/aerdrv_core.c:573: error: unknown field 'out' specified in initializer

It's strange. After I reverted the mentioned commit (about
Makefile.build) and applied my patch I got no warnings
CC [M] samples/kfifo/inttype-example.o
CC [M] samples/kfifo/record-example.o

> gcc-4.4.4.

gcc 4.7.2 might be the case.

--
With Best Regards,
Andy Shevchenko


\
 
 \ /
  Last update: 2012-11-29 14:41    [W:0.054 / U:25.224 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site