From mboxrd@z Thu Jan 1 00:00:00 1970 From: Oliver Upton Date: Thu, 25 Apr 2024 22:41:32 +0000 Subject: [PATCH] KVM: selftest: Define _GNU_SOURCE for all selftests code In-Reply-To: <20240423190308.2883084-1-seanjc@google.com> References: <20240423190308.2883084-1-seanjc@google.com> Message-ID: List-Id: To: kvm-riscv@lists.infradead.org MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit 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 > Signed-off-by: Sean Christopherson Acked-by: Oliver Upton -- Thanks, Oliver From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from out-186.mta1.migadu.com (out-186.mta1.migadu.com [95.215.58.186]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 926AD80BFF for ; Thu, 25 Apr 2024 22:41:40 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=95.215.58.186 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714084902; cv=none; b=pcDT6jJahJ0TWgqRHZlQw1d/n3eL9wJL6AMovpyh3zdGqVWnJfWINFIysNea7yIMKpM/iOUgQuOu2Fkjz8v8KHNgcLApJN/XQuMy8HxenbsSujBhQmcZ+Q+S0OkkC7yhtR+6MiuR1p5n4ZMDxjZR6jGrvJ9682ECdD09JoE1Mfw= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714084902; c=relaxed/simple; bh=oIbf+AzJRKngb2p73mGFU+CuiAIWLnjaDZekQY9OMek=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=tbta8w3Q579TkTgwx6h213ylTA4G8y/Q4qfdeJRQ1z96w8diCE/8mtgRwv8l8j+4bQcYIdMv7is91V6CeI2PjjflxTtAluOtgWnRTrz7bnU1AUSDz03FngxXVVbnAoyN84TyWnb3UEAiGBBAD+mdxe1ioYx6OkhNfanrfNigjXg= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.dev; spf=pass smtp.mailfrom=linux.dev; dkim=pass (1024-bit key) header.d=linux.dev header.i=@linux.dev header.b=flIG79Ky; arc=none smtp.client-ip=95.215.58.186 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.dev Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linux.dev Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linux.dev header.i=@linux.dev header.b="flIG79Ky" Date: Thu, 25 Apr 2024 22:41:32 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.dev; s=key1; t=1714084898; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=GCaJfAPaJTJk4qPysJNwA1mMKwjvwJd7/RjWgxHGHyY=; b=flIG79Ky9avijT6lxv6ruTzaWrjTez3ao65sse6mEFWL42L71Fy+HwoaFDVgbhqSQc8Plc 2zVls0Jn+yPxfrWHmLf2RsKd04+qj9yHIh5kAk1zeFvGngWMAknB7HIf4j1elRNjy/VQeD 3uDkbrZxw2MMlKn7IbsrZ3Do8tWuOuc= X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. From: Oliver Upton To: Sean Christopherson Cc: Paolo Bonzini , Marc Zyngier , Anup Patel , Paul Walmsley , Palmer Dabbelt , Albert Ou , Christian Borntraeger , Janosch Frank , Claudio Imbrenda , kvm@vger.kernel.org, linux-arm-kernel@lists.infradead.org, kvmarm@lists.linux.dev, kvm-riscv@lists.infradead.org, linux-riscv@lists.infradead.org, linux-kernel@vger.kernel.org, Muhammad Usama Anjum Subject: Re: [PATCH] KVM: selftest: Define _GNU_SOURCE for all selftests code Message-ID: References: <20240423190308.2883084-1-seanjc@google.com> Precedence: bulk X-Mailing-List: kvmarm@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20240423190308.2883084-1-seanjc@google.com> X-Migadu-Flow: FLOW_OUT 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 > Signed-off-by: Sean Christopherson Acked-by: Oliver Upton -- Thanks, Oliver From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 5F7F3C10F1A for ; Thu, 25 Apr 2024 22:41:58 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References: Message-ID:Subject:Cc:To:From:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=KtU9TnCJqJ0OQjIzNOBaBko8JgkVGryRoPSwLUbNl3Q=; b=XIlPrbElJDDaly w/Ue5HudNtH9v+f6WdVe9cmJKLP0Ed6Kdep+A4S+5Uz66hXEMasBghbmdMopmde8kt5sq3tT7cV7+ EF+YnN051IXMNvDMe+wtjyfinucqHmmrFsE22jdwjVaonnvnPg4ImppDxpzeNMY6RFInDWoezDP+2 lqG1vO/HkGQ60u55EMoMsX1Wgz0NjKPG8/h9lnuRhCc/NDYRuq2uo21CMny0yeZXFKv98qG/5bIJO 7VgUgCDmsZcnXLSVZ7O1E9OlNkR2WOHN9LAWuj/Iq8ixkO64NIEnXjwLIMkOVXZWsGxIuxFM2eYrc KcJw49s7hrqsSZvXj0ig==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1s07mo-0000000AVKZ-1uXx; Thu, 25 Apr 2024 22:41:50 +0000 Received: from out-175.mta1.migadu.com ([2001:41d0:203:375::af]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1s07ml-0000000AVHt-1HWj for linux-riscv@lists.infradead.org; Thu, 25 Apr 2024 22:41:48 +0000 Date: Thu, 25 Apr 2024 22:41:32 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.dev; s=key1; t=1714084898; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=GCaJfAPaJTJk4qPysJNwA1mMKwjvwJd7/RjWgxHGHyY=; b=flIG79Ky9avijT6lxv6ruTzaWrjTez3ao65sse6mEFWL42L71Fy+HwoaFDVgbhqSQc8Plc 2zVls0Jn+yPxfrWHmLf2RsKd04+qj9yHIh5kAk1zeFvGngWMAknB7HIf4j1elRNjy/VQeD 3uDkbrZxw2MMlKn7IbsrZ3Do8tWuOuc= X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. From: Oliver Upton To: Sean Christopherson Cc: Paolo Bonzini , Marc Zyngier , Anup Patel , Paul Walmsley , Palmer Dabbelt , Albert Ou , Christian Borntraeger , Janosch Frank , Claudio Imbrenda , kvm@vger.kernel.org, linux-arm-kernel@lists.infradead.org, kvmarm@lists.linux.dev, kvm-riscv@lists.infradead.org, linux-riscv@lists.infradead.org, linux-kernel@vger.kernel.org, Muhammad Usama Anjum Subject: Re: [PATCH] KVM: selftest: Define _GNU_SOURCE for all selftests code Message-ID: References: <20240423190308.2883084-1-seanjc@google.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20240423190308.2883084-1-seanjc@google.com> X-Migadu-Flow: FLOW_OUT X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240425_154147_501167_08D42DB0 X-CRM114-Status: GOOD ( 10.55 ) X-BeenThere: linux-riscv@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-riscv" Errors-To: linux-riscv-bounces+linux-riscv=archiver.kernel.org@lists.infradead.org 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 > Signed-off-by: Sean Christopherson Acked-by: Oliver Upton -- Thanks, Oliver _______________________________________________ linux-riscv mailing list linux-riscv@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-riscv From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 05D59C4345F for ; Thu, 25 Apr 2024 22:41:56 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References: Message-ID:Subject:Cc:To:From:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=hVLkhUbnYpkSr9wmXC6BFG0PrWViIHxpGR95mCFlqD8=; b=ozSILvNE/aclDr uVe2k7KweFWiVfz/+0NJ/ZohvKhcDcIUhSx7iUYq4Xbs4fulTarlml7GfOPhikioeCjbRv2PKP0MM 4eYMhgb3MoJQhmV8lJBbzLBGasEUXbJDN2/CDpj+BgptiVZ+Ot+N1Uh2Q7cgV+PgZZcmxPwAtVYRB xrz2f/VG0edz0si/lKcal82XQV9PWlm+fQWiDsL/3RHhF/xXJQ6PvURCVguO4d9Cner19u0ULTl9P 0oEtHE3471w1zmZo0c89JPS3QCOajP4TdjGQQPqPfCmPH8nWWgYrbyaQ1JzhO1SXfAHnZBRRYIvWX YIyhP77RDGlMiMCwipbw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1s07mk-0000000AVJ2-1rTx; Thu, 25 Apr 2024 22:41:46 +0000 Received: from out-171.mta1.migadu.com ([95.215.58.171]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1s07mh-0000000AVHq-0cS2 for linux-arm-kernel@lists.infradead.org; Thu, 25 Apr 2024 22:41:44 +0000 Date: Thu, 25 Apr 2024 22:41:32 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.dev; s=key1; t=1714084898; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=GCaJfAPaJTJk4qPysJNwA1mMKwjvwJd7/RjWgxHGHyY=; b=flIG79Ky9avijT6lxv6ruTzaWrjTez3ao65sse6mEFWL42L71Fy+HwoaFDVgbhqSQc8Plc 2zVls0Jn+yPxfrWHmLf2RsKd04+qj9yHIh5kAk1zeFvGngWMAknB7HIf4j1elRNjy/VQeD 3uDkbrZxw2MMlKn7IbsrZ3Do8tWuOuc= X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. From: Oliver Upton To: Sean Christopherson Cc: Paolo Bonzini , Marc Zyngier , Anup Patel , Paul Walmsley , Palmer Dabbelt , Albert Ou , Christian Borntraeger , Janosch Frank , Claudio Imbrenda , kvm@vger.kernel.org, linux-arm-kernel@lists.infradead.org, kvmarm@lists.linux.dev, kvm-riscv@lists.infradead.org, linux-riscv@lists.infradead.org, linux-kernel@vger.kernel.org, Muhammad Usama Anjum Subject: Re: [PATCH] KVM: selftest: Define _GNU_SOURCE for all selftests code Message-ID: References: <20240423190308.2883084-1-seanjc@google.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20240423190308.2883084-1-seanjc@google.com> X-Migadu-Flow: FLOW_OUT X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240425_154143_551987_27D14E20 X-CRM114-Status: GOOD ( 11.52 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org 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 > Signed-off-by: Sean Christopherson Acked-by: Oliver Upton -- Thanks, Oliver _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel