qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: "Philippe Mathieu-Daudé" <philmd@linaro.org>
To: "Stefan Weil" <sw@weilnetz.de>,
	qemu-devel@nongnu.org, "Paolo Bonzini" <pbonzini@redhat.com>,
	"Marc-André Lureau" <marcandre.lureau@redhat.com>
Cc: Hanna Reitz <hreitz@redhat.com>,
	qemu-block@nongnu.org, Kevin Wolf <kwolf@redhat.com>,
	Peter Wu <peter@lekensteyn.nl>,
	Julio Faracco <jcfaracco@gmail.com>
Subject: Re: [PATCH-for-8.0] block/dmg: Ignore C99 prototype declaration mismatch from <lzfse.h>
Date: Mon, 27 Mar 2023 20:58:12 +0200	[thread overview]
Message-ID: <e4a0b994-965a-2bd4-5517-b11e31b002ee@linaro.org> (raw)
In-Reply-To: <cc1f75ce-0295-cc57-1a74-71e036862bb7@weilnetz.de>

+Marc-André & Paolo

On 27/3/23 19:08, Stefan Weil wrote:
> Am 27.03.23 um 17:13 schrieb Philippe Mathieu-Daudé:
> 
>> When liblzfe (Apple LZFSE compression library) is present
>> (for example installed via 'brew') on Darwin, QEMU build
>> fails as:
>>
>>    Has header "lzfse.h" : YES
>>    Library lzfse found: YES
>>
>>      Dependencies
>>        lzo support                  : NO
>>        snappy support               : NO
>>        bzip2 support                : YES
>>        lzfse support                : YES
>>        zstd support                 : YES 1.5.2
>>
>>      User defined options
>>        dmg                          : enabled
>>        lzfse                        : enabled
>>
>>    [221/903] Compiling C object libblock.fa.p/block_dmg-lzfse.c.o
>>    FAILED: libblock.fa.p/block_dmg-lzfse.c.o
>>    /opt/homebrew/Cellar/lzfse/1.0/include/lzfse.h:56:43: error: this 
>> function declaration is not a prototype [-Werror,-Wstrict-prototypes]
>>    LZFSE_API size_t lzfse_encode_scratch_size();
>>                                              ^
>>                                               void
>>    /opt/homebrew/Cellar/lzfse/1.0/include/lzfse.h:94:43: error: this 
>> function declaration is not a prototype [-Werror,-Wstrict-prototypes]
>>    LZFSE_API size_t lzfse_decode_scratch_size();
>>                                              ^
>>                                               void
>>    2 errors generated.
>>    ninja: build stopped: subcommand failed.
>>
>> This issue has been reported in the lzfse project in 2016:
>> https://github.com/lzfse/lzfse/issues/3#issuecomment-226574719
>>
>> Since the project seems unmaintained, simply ignore the
>> strict-prototypes warning check for the <lzfse.h> header,
>> similarly to how we deal with the GtkItemFactoryCallback
>> prototype from <gtk/gtkitemfactory.h>, indirectly included
>> by <gtk/gtk.h>.
>>
>> Cc: Julio Faracco <jcfaracco@gmail.com>
>> Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
>> ---
>>   block/dmg-lzfse.c | 5 +++++
>>   1 file changed, 5 insertions(+)
>>
>> diff --git a/block/dmg-lzfse.c b/block/dmg-lzfse.c
>> index 6798cf4fbf..0abc970bf6 100644
>> --- a/block/dmg-lzfse.c
>> +++ b/block/dmg-lzfse.c
>> @@ -23,7 +23,12 @@
>>    */
>>   #include "qemu/osdep.h"
>>   #include "dmg.h"
>> +
>> +/* Work around an -Wstrict-prototypes warning in LZFSE headers */
> 
> 
> "Work around a -Wstrict-prototypes" ("a" instead of "an")?
> 
> 
>> +#pragma GCC diagnostic push
>> +#pragma GCC diagnostic ignored "-Wstrict-prototypes"
>>   #include <lzfse.h>
>> +#pragma GCC diagnostic pop
>>   static int dmg_uncompress_lzfse_do(char *next_in, unsigned int 
>> avail_in,
>>                                      char *next_out, unsigned int 
>> avail_out)
> 
> 
> The warning can also be suppressed if the build uses `-isystem 
> /opt/homebrew/include` instead of `-I/opt/homebrew/include` as I just 
> have tested.

IIUC by design meson only allows including *relative* directories,
and manage the system ones:
https://mesonbuild.com/Include-directories.html

> If we can find a solution how to implement that I thing it would look 
> nicer. Technically the patch looks good.
> 
> Reviewed-by: Stefan Weil <sw@weilnetz.de>

Thanks!


  reply	other threads:[~2023-03-27 18:59 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-03-27 15:13 [PATCH-for-8.0] block/dmg: Ignore C99 prototype declaration mismatch from <lzfse.h> Philippe Mathieu-Daudé
2023-03-27 17:08 ` Stefan Weil via
2023-03-27 18:58   ` Philippe Mathieu-Daudé [this message]
2023-03-27 21:09     ` Paolo Bonzini
2023-03-28  6:29       ` Stefan Weil via
2023-03-28 13:12         ` Philippe Mathieu-Daudé
2023-03-30 14:26 ` 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=e4a0b994-965a-2bd4-5517-b11e31b002ee@linaro.org \
    --to=philmd@linaro.org \
    --cc=hreitz@redhat.com \
    --cc=jcfaracco@gmail.com \
    --cc=kwolf@redhat.com \
    --cc=marcandre.lureau@redhat.com \
    --cc=pbonzini@redhat.com \
    --cc=peter@lekensteyn.nl \
    --cc=qemu-block@nongnu.org \
    --cc=qemu-devel@nongnu.org \
    --cc=sw@weilnetz.de \
    /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).