Skip to content

Werror=enum-int-mismatch error whlie trying to compile #218

Open
@blue-devil

Description

@blue-devil

Hello

My host machine is Arch Linux ARM (aarch64)

I have cloned and used the parameters for configure as stated:

../configure --target-list=arc-softmmu,arc64-softmmu,arc-linux-user,arc64-linux-user --prefix=/usr --enable-debug --enable-debug-tcg --enable-trace-backends=simple --disable-plugins --skip-meson --disable-pie

But when I try to make I got a Werror=enum-int-mismatch error:

Full log: https://pastebin.com/uvZ0J0xh

Error part of the log:

[690/2635] Compiling C object libqemuutil.a.p/stubs_vm-stop.c.o
[691/2635] Compiling C object libqemuutil.a.p/stubs_win32-kbd-hook.c.o
[692/2635] Compiling C object libqemuutil.a.p/stubs_cpu-synchronize-state.c.o
[693/2635] Compiling C object libqemuutil.a.p/stubs_replay-tools.c.o
FAILED: libqemuutil.a.p/stubs_replay-tools.c.o
cc -Ilibqemuutil.a.p -I. -I.. -Isubprojects/libvhost-user -I../subprojects/libvhost-user -Iqapi -Itrace -Iui -Iui/shader -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -I/usr/include/libmount -I/usr/include/blkid -I/usr/include/sysprof-6 -I/usr/include/gio-unix-2.0 -I/usr/include/p11-kit-1 -I/usr/include/pixman-1 -fdiagnostics-color=auto -Wall -Winvalid-pch -Werror -std=gnu11 -O0 -g -isystem /home/user/1/qemu/linux-headers -isystem linux-headers -iquote . -iquote /home/user/1/qemu -iquote /home/user/1/qemu/include -iquote /home/user/1/qemu/disas/libvixl -iquote /home/user/1/qemu/tcg/aarch64 -pthread -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 -fstack-protector-strong -MD -MQ libqemuutil.a.p/stubs_replay-tools.c.o -MF libqemuutil.a.p/stubs_replay-tools.c.o.d -o libqemuutil.a.p/stubs_replay-tools.c.o -c ../stubs/replay-tools.c
../stubs/replay-tools.c:10:9: error: conflicting types for ‘replay_save_clock’ due to enum/integer mismatch; have ‘int64_t(unsigned int,  int64_t,  int64_t)’ {aka ‘long int(unsigned int,  long int,  long int)’} [-Werror=enum-int-mismatch]
   10 | int64_t replay_save_clock(unsigned int kind, int64_t clock, int64_t raw_icount)
      |         ^~~~~~~~~~~~~~~~~
In file included from ../stubs/replay-tools.c:2:
/home/user/1/qemu/include/sysemu/replay.h:128:9: note: previous declaration of ‘replay_save_clock’ with type ‘int64_t(ReplayClockKind,  int64_t,  int64_t)’ {aka ‘long int(ReplayClockKind,  long int,  long int)’}
  128 | int64_t replay_save_clock(ReplayClockKind kind, int64_t clock,
      |         ^~~~~~~~~~~~~~~~~
../stubs/replay-tools.c:16:9: error: conflicting types for ‘replay_read_clock’ due to enum/integer mismatch; have ‘int64_t(unsigned int,  int64_t)’ {aka ‘long int(unsigned int,  long int)’} [-Werror=enum-int-mismatch]
   16 | int64_t replay_read_clock(unsigned int kind, int64_t raw_icount)
      |         ^~~~~~~~~~~~~~~~~
/home/user/1/qemu/include/sysemu/replay.h:131:9: note: previous declaration of ‘replay_read_clock’ with type ‘int64_t(ReplayClockKind,  int64_t)’ {aka ‘long int(ReplayClockKind,  long int)’}
  131 | int64_t replay_read_clock(ReplayClockKind kind, int64_t raw_icount);
      |         ^~~~~~~~~~~~~~~~~
cc1: all warnings being treated as errors
[694/2635] Compiling C object libqemuutil.a.p/stubs_fw_cfg.c.o
[695/2635] Compiling C object libqemuutil.a.p/stubs_pci-bus.c.o
ninja: build stopped: subcommand failed.
make: *** [Makefile:163: run-ninja] Error 1

Any help is welcome thank you

NOTE: I have successfully compile and run this repo under Ubuntu 2022 ARM.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions