blob: 7278f8ad8f71dbe60c72e8850d6e6bc2b217da0f (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
|
id = 1295
title = "configure script can fail if compiler flag `-Wunused-parameter` is enabled"
state = "closed"
created_at = "2022-11-02T20:07:03.088Z"
closed_at = "2022-11-28T19:27:40.699Z"
labels = ["Build System", "hostos: Windows", "kind::Bug"]
url = "https://gitlab.com/qemu-project/qemu/-/issues/1295"
host-os = "Debian GNU Linux bullseye (stable)"
host-arch = "x86_64"
qemu-version = "Git master"
guest-os = "n/a"
guest-arch = "n/a"
description = """`configure` fails with an error message:
```
ERROR: SafeStack is only supported by the coroutine backend ucontext
```"""
reproduce = """1. Run `./configure --cross-prefix=x86_64-w64-mingw32- --disable-werror --extra-cflags=-Wunused-parameter`"""
additional = """Last part of `config.log`:
```
x86_64-w64-mingw32-gcc -m64 -mcx16 -I/mingw64/include -Wunused-parameter -fno-pie -mthreads -std=gnu11 -Wall -fno-pie -no-pie -D_GNU_SOURCE -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -Wstrict-prototypes -Wredundant-decls -Wundef -Wwrite-strings -Wmissing-prototypes -fno-strict-aliasing -fno-common -fwrapv -Wold-style-declaration -Wold-style-definition -Wtype-limits -Wformat-security -Wformat-y2k -Winit-self -Wignored-qualifiers -Wempty-body -Wnested-externs -Wendif-labels -Wexpansion-to-defined -Wimplicit-fallthrough=2 -Wno-missing-include-dirs -Wno-shift-negative-value -Wno-psabi -Werror -o config-temp/qemu-conf.exe config-temp/qemu-conf.c -L/mingw64/lib -no-pie
config-temp/qemu-conf.c: In function ‘main’:
config-temp/qemu-conf.c:1:14: error: unused parameter ‘argc’ [-Werror=unused-parameter]
1 | int main(int argc, char *argv[])
| ~~~~^~~~
config-temp/qemu-conf.c:1:26: error: unused parameter ‘argv’ [-Werror=unused-parameter]
1 | int main(int argc, char *argv[])
| ~~~~~~^~~~~~
cc1: all warnings being treated as errors
```
The configure script fails because it tries to compile small C programs with a main function which is declared with arguments `argc` and `argv` although those arguments are unused.
Using the same compiler flag for a native build (`./configure --disable-werror --extra-cflags=-Wunused-parameter`) shows the same errors in `config.log`, but surprisingly does not fail."""
|