qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Thomas Huth <thuth@redhat.com>
To: "Daniel P. Berrangé" <berrange@redhat.com>,
	"Peter Maydell" <peter.maydell@linaro.org>
Cc: QEMU Developers <qemu-devel@nongnu.org>,
	Ronnie Sahlberg <ronniesahlberg@gmail.com>,
	Paolo Bonzini <pbonzini@redhat.com>, Peter Lieven <pl@kamp.de>,
	Qemu-block <qemu-block@nongnu.org>
Subject: Re: [Qemu-devel] [PATCH] configure: Work-around a bug in libiscsi 1.9.0 when used in gnu99 mode
Date: Mon, 14 Jan 2019 15:38:14 +0100	[thread overview]
Message-ID: <08e1fa1c-1729-bc5f-3532-06cd5f7738bf@redhat.com> (raw)
In-Reply-To: <20190114143144.GH3686@redhat.com>

On 2019-01-14 15:31, Daniel P. Berrangé wrote:
> On Mon, Jan 14, 2019 at 01:52:01PM +0000, Peter Maydell wrote:
>> On Mon, 14 Jan 2019 at 13:47, Thomas Huth <thuth@redhat.com> wrote:
>>>
>>> The header "scsi-lowlevel.h" of libiscsi 1.9.0 contains some bad
>>> "inline" prototype definitions which GCC refuses to compile in its
>>> gnu99 mode:
>>>
>>> In file included from block/iscsi.c:52:0:
>>> /usr/include/iscsi/scsi-lowlevel.h:810:13: error: inline function
>>> ‘scsi_set_uint16’ declared but never defined [-Werror]
>>>  inline void scsi_set_uint16(unsigned char *c, uint16_t val);
>>>              ^
>>> /usr/include/iscsi/scsi-lowlevel.h:809:13: error: inline function
>>> ‘scsi_set_uint32’ declared but never defined [-Werror]
>>>  inline void scsi_set_uint32(unsigned char *c, uint32_t val);
>>>              ^
>>>
>>> This has been fixed by upstream libiscsi in version 1.10.0 (see
>>> https://github.com/sahlberg/libiscsi/commit/7692027d6c11 ), but
>>> since we still want to support 1.9.0 for CentOS 7 / RHEL7, we
>>> have to work-around the issue by compiling with "-fgnu89-inline"
>>> in this case instead.
>>>
>>> Suggested-by: Daniel P. Berrangé <berrange@redhat.com>
>>> Signed-off-by: Thomas Huth <thuth@redhat.com>
>>> ---
>>>  configure | 5 +++++
>>>  1 file changed, 5 insertions(+)
>>>
>>> diff --git a/configure b/configure
>>> index 2b9ba7d..aa80c17 100755
>>> --- a/configure
>>> +++ b/configure
>>> @@ -4562,6 +4562,11 @@ if test "$libiscsi" != "no" ; then
>>>      libiscsi="yes"
>>>      libiscsi_cflags=$($pkg_config --cflags libiscsi)
>>>      libiscsi_libs=$($pkg_config --libs libiscsi)
>>> +    if $pkg_config --exact-version==1.9.0 libiscsi; then
>>> +      # There are some bad inline declarations in scsi-lowlevel.h of
>>> +      # libiscsi 1.9.0 which don't work in gnu99 mode without this:
>>> +      libiscsi_cflags="-fgnu89-inline $libiscsi_cflags"
>>> +    fi
>>
>> Can we suppress the warnings with #pragma instead ?
>> That would avoid compiling the .o file with different
>> C semantics.
> 
> IIUC this is a built-in warning you can't disable, except by changing
> the compilation mode to have gnu89 inline semantics :-(

Right, I just tried things like:

#pragma GCC diagnostic ignored "-Wunused-function"

but nothing seems to help here. Looks like this can not be disabled
seperately.

> I'd rather we just added  -Wno-error  to libiscsi_cflags instead of
> changing compilation mode.

Fine for me, too.

 Thomas

  reply	other threads:[~2019-01-14 14:38 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-01-14 13:46 [Qemu-devel] [PATCH] configure: Work-around a bug in libiscsi 1.9.0 when used in gnu99 mode Thomas Huth
2019-01-14 13:52 ` Peter Maydell
2019-01-14 14:31   ` Daniel P. Berrangé
2019-01-14 14:38     ` Thomas Huth [this message]
2019-01-14 14:50     ` Eric Blake
2019-01-14 14:53       ` Thomas Huth
2019-01-14 15:02         ` Eric Blake
2019-01-14 15:23           ` Thomas Huth
2019-01-14 15:37             ` Thomas Huth
2019-01-14 15:05         ` Daniel P. Berrangé
2019-01-14 14:31 ` Philippe Mathieu-Daudé
2019-01-14 14:36   ` Thomas Huth
2019-01-14 15:15     ` Philippe Mathieu-Daudé

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=08e1fa1c-1729-bc5f-3532-06cd5f7738bf@redhat.com \
    --to=thuth@redhat.com \
    --cc=berrange@redhat.com \
    --cc=pbonzini@redhat.com \
    --cc=peter.maydell@linaro.org \
    --cc=pl@kamp.de \
    --cc=qemu-block@nongnu.org \
    --cc=qemu-devel@nongnu.org \
    --cc=ronniesahlberg@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).