From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-pj1-f74.google.com (mail-pj1-f74.google.com [209.85.216.74]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id DF31312DDBD for ; Wed, 1 May 2024 13:24:38 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.216.74 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714569880; cv=none; b=YuZ7kbb5xCMy6N3zjpuoFdacO1ZmNQUuLjJm5pniYHFh0lLHERghYx2Rvuun8eaKYZoQWEALWAZvdCzvwGw4N+uY7hO0YBimNcy9uUTo/dOUAKB5tAfhL2MaCxbNFoGmPOSWvfJhwHGd9M4OHdMUJZSR/bJTTJXUVJim0LPWYLI= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714569880; c=relaxed/simple; bh=krrfckqjbeQlFLb67v3IVek4EQvt8apnoVfcRYoUsg8=; h=Date:In-Reply-To:Mime-Version:References:Message-ID:Subject:From: To:Cc:Content-Type; b=FdaJrMpq6NmKkHaxP2OKJwo+WSx6uThUoxQuBlmnvqOBxwYMgDEZOuJnzeul9LJ9xf3XkEPXUL78OyYSSc7Ra+5R/YGyG4harsSdblhrpeLhFgpr9xZZMaLvBTO9ivaMR1fTDCRfmhLHDg5630nNGUur59aeJbuymhzomFBbhNI= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com; spf=pass smtp.mailfrom=flex--seanjc.bounces.google.com; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b=z4PSvnZZ; arc=none smtp.client-ip=209.85.216.74 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=flex--seanjc.bounces.google.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b="z4PSvnZZ" Received: by mail-pj1-f74.google.com with SMTP id 98e67ed59e1d1-2a473ba0632so7960124a91.0 for ; Wed, 01 May 2024 06:24:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1714569878; x=1715174678; darn=vger.kernel.org; h=cc:to:from:subject:message-id:references:mime-version:in-reply-to :date:from:to:cc:subject:date:message-id:reply-to; bh=4j6TmQ6ZgTGCAdIqQxwPqCx/nTzh+QyhXiuMiXZrc1A=; b=z4PSvnZZow+6cwPT+0ewrIkZ1zd7BDzLa+B4BwRbWfQeul8nzOsi19rm0gzFJB29a5 X1qrmI4UmTxNrE8laFdrt5n0s1LOcdAQUyN8KlFjksLa19gdfLjN9rdxS7rkHH6wHmSx Dt6vno8vuOBbKIVaNd/ZSN209Qkb/aM/VBPR0OgIPrRnR7/vkHGp68RZbNptbw41mTFa 3d043BKnXcNsJkhd/u6ytclKWj9RxAZpUPm0bNkT0+lSbw6W9UH6MMOoIsVtz9Jxpx/l 0NrMuyLM5KyCds8FWf26I6GWndEOa1VsaXVD1/lqiTKKSTp/prHyQE9HYEcdSmd7GLiI 2DfQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1714569878; x=1715174678; h=cc:to:from:subject:message-id:references:mime-version:in-reply-to :date:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=4j6TmQ6ZgTGCAdIqQxwPqCx/nTzh+QyhXiuMiXZrc1A=; b=q/wlygnHspgggrJv+B3H+0syZ2HHoGj0caXTCIcM56Ge8Y5ohIYsgD6IenXJpgnvqM yyyQ1VIQd3oYm3hO7hDijMauvIQjcExzzURhIMpP7m8CiJ1q/e9nEp5tBdCqpOCl9sKz rWklUIztxq7FQDBAOcYE8sRauIB37pnU8qK3wv2rEaaYv72lNuZTjXeFUYsd/5J+8mC2 DP6xsGeOCqseTAVZBG8j4TEi1YKXhYpYsX+qMZAM36YWXlJWWPob3MOMgMp5ntpB1ev5 6oT5PI27AYv4gfp6mXMRwdSpN4BkkknQsuSgJvV6yCo8lAgZ6h4BcSP9eTYJDYo86HMK S2vA== X-Forwarded-Encrypted: i=1; AJvYcCU7pvW5L563EI+U8Q+CR/EvrRe7vmMNdekwgg7yw1kenVi2IH/q/DXUtoo97ZB04tz9xiCI6uYJ0WHjzE6oUJpUvnj3BWjp X-Gm-Message-State: AOJu0YzSFho40a8X0TssxBKKyg7XdnMP0m0cW1V6abe43995ddMfjXbP NxFOBJ7KhkCNnIBDVImJvzJvxOlF6fmUgSVJaVyoQR3Kqr/klb+pW/IeZ3pL/XrJd1tfJukJNK/ yMg== X-Google-Smtp-Source: AGHT+IF3937EXGaxRuC2iwKEsqWkwYndGF2ruoyJWYYFvQeb8jNS6z1A7kQ93TL3uURuwu8bhUtDSRxNorw= X-Received: from zagreus.c.googlers.com ([fda3:e722:ac3:cc00:7f:e700:c0a8:5c37]) (user=seanjc job=sendgmr) by 2002:a17:90b:b0f:b0:2b0:14bf:3f45 with SMTP id bf15-20020a17090b0b0f00b002b014bf3f45mr7454pjb.0.1714569878155; Wed, 01 May 2024 06:24:38 -0700 (PDT) Date: Wed, 1 May 2024 06:24:36 -0700 In-Reply-To: Precedence: bulk X-Mailing-List: netdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: Mime-Version: 1.0 References: <20240430235057.1351993-1-edliaw@google.com> Message-ID: Subject: Re: [PATCH v1 00/10] Define _GNU_SOURCE for sources using From: Sean Christopherson To: Mark Brown Cc: Edward Liaw , shuah@kernel.org, Jaroslav Kysela , Takashi Iwai , Jiri Kosina , Benjamin Tissoires , Paolo Bonzini , Bongsu Jeon , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Alexandre Belloni , Jarkko Sakkinen , Dave Hansen , Andrew Morton , Muhammad Usama Anjum , linux-kernel@vger.kernel.org, linux-kselftest@vger.kernel.org, kernel-team@android.com, linux-sound@vger.kernel.org, linux-input@vger.kernel.org, kvm@vger.kernel.org, netdev@vger.kernel.org, linux-rtc@vger.kernel.org, linux-sgx@vger.kernel.org Content-Type: text/plain; charset="us-ascii" On Wed, May 01, 2024, Mark Brown wrote: > On Tue, Apr 30, 2024 at 11:50:09PM +0000, Edward Liaw wrote: > > 809216233555 ("selftests/harness: remove use of LINE_MAX") introduced > > asprintf into kselftest_harness.h, which is a GNU extension and needs > > _GNU_SOURCE to either be defined prior to including headers or with the > > -D_GNU_SOURCE flag passed to the compiler. > > This seems like something that should be handled centrally rather than > having to go round and audit the users every time some update is made. +1. And if for some reason unilaterally defining _GNU_SOURCE in tools/testing/selftests/lib.mk isn't an option, we should at least have kselftest_harness.h assert instead of making a futile attempt to provide its own definition, e.g. diff --git a/tools/testing/selftests/kselftest_harness.h b/tools/testing/selftests/kselftest_harness.h index 4fd735e48ee7..6741b4f20f25 100644 --- a/tools/testing/selftests/kselftest_harness.h +++ b/tools/testing/selftests/kselftest_harness.h @@ -51,7 +51,7 @@ #define __KSELFTEST_HARNESS_H #ifndef _GNU_SOURCE -#define _GNU_SOURCE +static_assert(0, "Using the kselftests harness requires building with _GNU_SOURCE"); #endif #include #include