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


Groups > linux.kernel > #1308776

Re: PROBLEM: compilation issue, Incorrect C usage in drivers/block/null_blk.c causes kernel compilation failure with Intel c++ compiler

From Jens Axboe <axboe@kernel.dk>
Newsgroups linux.kernel
Subject Re: PROBLEM: compilation issue, Incorrect C usage in drivers/block/null_blk.c causes kernel compilation failure with Intel c++ compiler
Date 2016-01-13 21:10 +0100
Message-ID <qQzTY-4GJ-11@gated-at.bofh.it> (permalink)
References <qQzhg-48x-13@gated-at.bofh.it> <qQzqV-4ct-1@gated-at.bofh.it> <qQzqV-4ct-11@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


[Multipart message — attachments visible in raw view] - view raw

On 01/13/2016 12:37 PM, Randy Dunlap wrote:
> [add Jens Axboe]
>
>
> On 01/13/16 11:35, Randy Dunlap wrote:
>> On 01/13/16 11:22, Blower, Melanie wrote:
>>> [1.]  Incorrect C usage in drivers/block/null_blk.c causes kernel compilation failure with Intel c++ compiler
>>> [2.] Full description of the problem/report:
>>> Using icc,
>>>      drivers/block/null_blk.c(569): error: variable "null_lnvm_dev_ops" was declared with a never-completed type
>>>      static struct nvm_dev_ops null_lnvm_dev_ops;
>>>
>>> Clark Nelson, one of Intel's C++ language lawyers, explains why this declaration is illegal:
>>>
>>>   Discussion:
>>>   Here is the problematic declaration, which appears near line 585 of file drivers/block/null_blk.c:
>>>
>>>        static struct nvm_dev_ops null_lnvm_dev_ops;

So that's a very verbose way of saying that the structure is undefined 
if CONFIG_NVM isn't set. I agree, that's crap code, doesn't make any 
sense. Surprised gcc doesn't complain about it.

Something like the attached should fix it, making enough visible with 
CONFIG_NVM that we can declare an empty ops type.

-- 
Jens Axboe

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


Thread

PROBLEM: compilation issue,  Incorrect C usage in  drivers/block/null_blk.c causes kernel compilation failure with Intel c++  compiler "Blower, Melanie" <melanie.blower@intel.com> - 2016-01-13 20:30 +0100
  Re: PROBLEM: compilation issue, Incorrect C usage in  drivers/block/null_blk.c causes kernel compilation failure with Intel c++  compiler Randy Dunlap <rdunlap@infradead.org> - 2016-01-13 20:40 +0100
    Re: PROBLEM: compilation issue, Incorrect C usage in  drivers/block/null_blk.c causes kernel compilation failure with Intel c++  compiler Randy Dunlap <rdunlap@infradead.org> - 2016-01-13 20:40 +0100
      Re: PROBLEM: compilation issue, Incorrect C usage in  drivers/block/null_blk.c causes kernel compilation failure with Intel c++  compiler Jens Axboe <axboe@kernel.dk> - 2016-01-13 21:10 +0100

csiph-web