lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <5696ACFE.5080403@kernel.dk>
Date:	Wed, 13 Jan 2016 13:01:02 -0700
From:	Jens Axboe <axboe@...nel.dk>
To:	Randy Dunlap <rdunlap@...radead.org>,
	"Blower, Melanie" <melanie.blower@...el.com>,
	"'tglx@...utronix.de'" <tglx@...utronix.de>,
	"'mingo@...hat.com'" <mingo@...hat.com>,
	"'hpa@...or.com'" <hpa@...or.com>,
	"'avi@...hat.com'" <avi@...hat.com>
Cc:	"'x86@...nel.org'" <x86@...nel.org>,
	"'kvm@...r.kernel.org'" <kvm@...r.kernel.org>,
	"'linux-kernel@...r.kernel.org'" <linux-kernel@...r.kernel.org>
Subject: Re: PROBLEM: compilation issue, Incorrect C usage in
 drivers/block/null_blk.c causes kernel compilation failure with Intel c++
 compiler

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


View attachment "nvm-ops.patch" of type "text/x-patch" (4195 bytes)

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ