libvhost-user: Declare uffdio_register early to make it C90 compliant
authorMarcel Holtmann <marcel@holtmann.org>
Thu, 22 Dec 2022 20:36:44 +0000 (21:36 +0100)
committerPaolo Bonzini <pbonzini@redhat.com>
Wed, 11 Jan 2023 09:44:34 +0000 (10:44 +0100)
commitd87a642403364d4704324197d75d41641287b4b1
tree6fc84fedcc0e65ab4d3436d0586842d2371276bd
parent92bf246130faa85b20ca8e3b6c4eda50d5825a5a
libvhost-user: Declare uffdio_register early to make it C90 compliant

When using libvhost-user source in an external project that wants to
comply with the C90 standard, it is best to declare variables before
code.

  CC       libvhost-user.o
libvhost-user.c: In function ‘generate_faults’:
libvhost-user.c:683:9: error: ISO C90 forbids mixed declarations and code [-Werror=declaration-after-statement]
  683 |         struct uffdio_register reg_struct;
      |         ^~~~~~

In this case, it is also simple enough and doesn't cause any extra
ifdef additions.

Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Message-Id: <556c2d00c01fa134d13c0371d4014c90694c2943.1671741278.git.marcel@holtmann.org>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
subprojects/libvhost-user/libvhost-user.c