[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <ZircHEd4GZPApm21@linux.dev>
Date: Thu, 25 Apr 2024 22:41:32 +0000
From: Oliver Upton <oliver.upton@...ux.dev>
To: Sean Christopherson <seanjc@...gle.com>
Cc: Paolo Bonzini <pbonzini@...hat.com>, Marc Zyngier <maz@...nel.org>,
Anup Patel <anup@...infault.org>,
Paul Walmsley <paul.walmsley@...ive.com>,
Palmer Dabbelt <palmer@...belt.com>,
Albert Ou <aou@...s.berkeley.edu>,
Christian Borntraeger <borntraeger@...ux.ibm.com>,
Janosch Frank <frankja@...ux.ibm.com>,
Claudio Imbrenda <imbrenda@...ux.ibm.com>, kvm@...r.kernel.org,
linux-arm-kernel@...ts.infradead.org, kvmarm@...ts.linux.dev,
kvm-riscv@...ts.infradead.org, linux-riscv@...ts.infradead.org,
linux-kernel@...r.kernel.org,
Muhammad Usama Anjum <usama.anjum@...labora.com>
Subject: Re: [PATCH] KVM: selftest: Define _GNU_SOURCE for all selftests code
On Tue, Apr 23, 2024 at 12:03:08PM -0700, Sean Christopherson wrote:
> Define _GNU_SOURCE is the base CFLAGS instead of relying on selftests to
> manually #define _GNU_SOURCE, which is repetitive and error prone. E.g.
> kselftest_harness.h requires _GNU_SOURCE for asprintf(), but if a selftest
> includes kvm_test_harness.h after stdio.h, the include guards result in
> the effective version of stdio.h consumed by kvm_test_harness.h not
> defining asprintf():
>
> In file included from x86_64/fix_hypercall_test.c:12:
> In file included from include/kvm_test_harness.h:11:
> ../kselftest_harness.h:1169:2: error: call to undeclared function
> 'asprintf'; ISO C99 and later do not support implicit function declarations
> [-Wimplicit-function-declaration]
> 1169 | asprintf(&test_name, "%s%s%s.%s", f->name,
> | ^
>
> When including the rseq selftest's "library" code, #undef _GNU_SOURCE so
> that rseq.c controls whether or not it wants to build with _GNU_SOURCE.
>
> Reported-by: Muhammad Usama Anjum <usama.anjum@...labora.com>
> Signed-off-by: Sean Christopherson <seanjc@...gle.com>
Acked-by: Oliver Upton <oliver.upton@...ux.dev>
--
Thanks,
Oliver
Powered by blists - more mailing lists