[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 6/6] block/dmg: Ignore C99 prototype declaration mismatch from <lz
From: |
Philippe Mathieu-Daudé |
Subject: |
[PULL 6/6] block/dmg: Ignore C99 prototype declaration mismatch from <lzfse.h> |
Date: |
Thu, 30 Mar 2023 15:18:56 +0200 |
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>
Reviewed-by: Stefan Weil <sw@weilnetz.de>
Message-Id: <20230327151349.97572-1-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..4ea0b9b20d 100644
--- a/block/dmg-lzfse.c
+++ b/block/dmg-lzfse.c
@@ -23,7 +23,12 @@
*/
#include "qemu/osdep.h"
#include "dmg.h"
+
+/* Work around a -Wstrict-prototypes warning in LZFSE headers */
+#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)
--
2.38.1
- [PULL 0/6] Misc fixes for 2023-03-30, Philippe Mathieu-Daudé, 2023/03/30
- [PULL 1/6] linux-user/sparc: Don't use 16-bit UIDs on SPARC V9, Philippe Mathieu-Daudé, 2023/03/30
- [PULL 2/6] linux-user/mips: Use P5600 as default CPU to run NaN2008 ELF binaries, Philippe Mathieu-Daudé, 2023/03/30
- [PULL 4/6] tests/avocado: Enable TuxRun/mips64 (big-endian) test, Philippe Mathieu-Daudé, 2023/03/30
- [PULL 5/6] hw/i2c: pmbus: block uninitialised string reads, Philippe Mathieu-Daudé, 2023/03/30
- [PULL 3/6] hw/mips/gt64xxx_pci: Don't endian-swap GT_PCI0_CFGADDR, Philippe Mathieu-Daudé, 2023/03/30
- [PULL 6/6] block/dmg: Ignore C99 prototype declaration mismatch from <lzfse.h>,
Philippe Mathieu-Daudé <=
- Re: [PULL 0/6] Misc fixes for 2023-03-30, Peter Maydell, 2023/03/31