[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PULL v3 26/28] seccomp: Work-around GCC 4.x bug in gnu
From: |
Eduardo Otubo |
Subject: |
Re: [Qemu-devel] [PULL v3 26/28] seccomp: Work-around GCC 4.x bug in gnu99 mode |
Date: |
Tue, 12 Feb 2019 11:35:41 +0100 |
User-agent: |
Mutt/1.8.3+47 (5f034395e53d) (2017-05-23) |
On 17/01/2019 - 14:38:12, Thomas Huth wrote:
> We'd like to compile QEMU with -std=gnu99, but GCC 4.8 currently
> fails to compile qemu-seccomp.c in this mode:
>
> qemu-seccomp.c:45:1: error: initializer element is not constant
> };
> ^
> qemu-seccomp.c:45:1: error: (near initialization for
> ‘sched_setscheduler_arg[0]’)
>
> This is due to a compiler bug which has just been fixed in GCC 5.0:
>
> https://gcc.gnu.org/bugzilla/show_bug.cgi?id=63567
>
> Since we still want to support GCC 4.8 for a while and also want to use
> gnu99 mode, work-around the issue by expanding the macro manually.
>
> Reviewed-by: Daniel P. Berrangé <address@hidden>
> Reviewed-by: Philippe Mathieu-Daudé <address@hidden>
> Signed-off-by: Thomas Huth <address@hidden>
> ---
> qemu-seccomp.c | 3 ++-
> 1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/qemu-seccomp.c b/qemu-seccomp.c
> index 5c73e6a..36d5829 100644
> --- a/qemu-seccomp.c
> +++ b/qemu-seccomp.c
> @@ -41,7 +41,8 @@ struct QemuSeccompSyscall {
> };
>
> const struct scmp_arg_cmp sched_setscheduler_arg[] = {
> - SCMP_A1(SCMP_CMP_NE, SCHED_IDLE)
> + /* was SCMP_A1(SCMP_CMP_NE, SCHED_IDLE), but expanded due to GCC 4.x bug
> */
> + { .arg = 1, .op = SCMP_CMP_NE, .datum_a = SCHED_IDLE }
> };
>
> static const struct QemuSeccompSyscall blacklist[] = {
> --
> 1.8.3.1
>
>
Just noticed you already sent the pull request, sorry, my tree was outdated.
Please ignore my previous email :)
--
Eduardo Otubo
signature.asc
Description: PGP signature
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- Re: [Qemu-devel] [PULL v3 26/28] seccomp: Work-around GCC 4.x bug in gnu99 mode,
Eduardo Otubo <=