From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-wm2-f13.google.com (mail-wm2-f13.google.com [74.125.225.141]) (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 D6BB035C68C for ; Sat, 19 Sep 2026 09:39:49 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=74.125.225.141 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1789810791; cv=none; b=N7cNV6NVDlcC3hy2FIg3skVKd0ykKUiV+G+/eAA9ge6GBnsuh8wsm2VG/HgeMU9wyOSJ1yyFji/l8/XCxyzrFu81XRWCRXiInasXHYP5kksCxJQsacW9VFNG5sTPjkc5ytukOlXCesaDZAGtXZ3s9/sPO9qVW8qUOZ9Yggj6HAc= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1789810791; c=relaxed/simple; bh=VnurqPrpnN+sAeEL0x3TldaQv3nsKFA2accKz2jjL5k=; h=Date:From:To:Cc:Subject:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=Fqu6hM60FkrpWQgHY+SKdG2/taL12jmFhuO0rGPfslRPu/9U0BG2ZpEfipWKraSjiBXD9lojOOZEw8nLeqppNXcQRpR2mNXCahH6HMfsMtm8XzrLKxPPAYw26TBlTZiLAeGnoybGQoOmQM8Nr/No+gWwwdeTrYGYC0zyKZBXqHk= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=Xdy4y/0d; arc=none smtp.client-ip=74.125.225.141 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="Xdy4y/0d" Received: by mail-wm2-f13.google.com with SMTP id 5b1f17b1804b1-49cd38e0e5dso19674355e9.2 for ; Sat, 19 Sep 2026 02:39:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1789810788; x=1790415588; darn=vger.kernel.org; h=content-transfer-encoding:content-type:mime-version:references :in-reply-to:message-id:subject:cc:to:from:date:from:to:cc:subject :date:message-id:reply-to:content-type; bh=uuNs+jmp7P80c+ETSoD8IhUkYAoa0hGSn0P6AjTo/tk=; b=Xdy4y/0d9E2EulS41gMojgLvVGEQa5wi6wotpFRTtA5Ug2QefACIn+1zHZfH4ZDUXk Zdc6t5JAYrL8mZCUeTf9NqrpUeIkVGOYHjXROLksUbQEOMX8U15kNJY96+RM9VjpQlGC 8Xg/n5gD1UQ8W8WuV/1+raPO3W4RQN5b0OHIJ9XBcKfCMBxy+lw1SSbXkSAr/mX6dRha ICmho3xvBFd9RHdsphEZ2ZzaYnzW3YxaCmjLauVBN1PnSkoNgkzUEk5jTM5YYrxgZ4MG XT2Rx9W1m87Y4EdaXCfpJVzn509bBTWF5mWaG1utt0zE2Bm908PNouVsG9uvgGJwba8n GU1g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20260707; t=1789810788; x=1790415588; h=content-transfer-encoding:content-type:mime-version:references :in-reply-to:message-id:subject:cc:to:from:date:x-gm-gg :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to :content-type; bh=uuNs+jmp7P80c+ETSoD8IhUkYAoa0hGSn0P6AjTo/tk=; b=lPh0fWKLPCSvrz35l7acDWOC8Olr0BmrCrqMSoXPOvueOw3u7NBCvnmbRkk7FrQhEc XFxAk8ApXDpGaYtRBtcD9hYR4oeszJwPeSWCwVF4mTG4s673TrR9t+pe68NaGLaMOt4e 7wREsfznKOxav6iHBOQKuuanxacPJ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nMF7EyBfmsyIjbZKCdQiWP0BLdScX5JJHR0B wGSso65FPST16l85pmeRk6g5Dt4Q58GA= X-Received: by 2002:a05:600c:1391:b0:49d:272d:74b4 with SMTP id 5b1f17b1804b1-49fc566e5ebmr66465085e9.2.1789810787947; Sat, 19 Sep 2026 02:39:47 -0700 (PDT) Received: from systembl0wer ([2a02:8308:4092:11f0::f9f]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-49fcd0ece6esm83417145e9.2.2026.09.19.02.39.47 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 19 Sep 2026 02:39:47 -0700 (PDT) Date: Sat, 19 Sep 2026 11:39:45 +0200 From: Joshua Crofts To: "Ivan A. Melnikov" Cc: Jonathan Cameron , David Lechner , Nuno =?UTF-8?B?U8Oh?= , Andy Shevchenko , Jonathan Cameron , Francesco Lavra , linux-iio@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] iio: tools: Use proper macro to detect _Float16 support Message-ID: <20260919113945.2bee973b@systembl0wer> In-Reply-To: <20260918161305.1161852-1-iv@altlinux.org> References: <20260918161305.1161852-1-iv@altlinux.org> X-Mailer: Claws Mail 4.4.0 (GTK 3.24.52; x86_64-redhat-linux-gnu) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit On Fri, 18 Sep 2026 20:13:02 +0400 "Ivan A. Melnikov" wrote: > __FLT16_MAX__ is an internal compiler macro. GCC defines it if > _Float16 is supported by the target in general, but the support > may depend on the exact target options. For example, on i586 > without -msse2 I get the following error from GCC15: > > iio_generic_buffer.c: In function 'print2byte': > iio_generic_buffer.c:141:17: error: invalid conversion from type '_Float16' without option '-msse2' > 141 | printf("%05f ", ((float)converter.f + info->offset) * info->scale); > | ^~~~~~ > > To fix that, use the public macro without double underscores. > > Fixes: cdd445d4b2a9 ("iio: tools: Add support for floating-point types in buffer scan elements") > Signed-off-by: Ivan A. Melnikov > --- > tools/iio/iio_generic_buffer.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/tools/iio/iio_generic_buffer.c b/tools/iio/iio_generic_buffer.c > index 000193612aad..9ea93984e0e9 100644 > --- a/tools/iio/iio_generic_buffer.c > +++ b/tools/iio/iio_generic_buffer.c > @@ -131,7 +131,7 @@ static void print2byte(uint16_t input, struct iio_channel_info *info) > printf("%05f ", ((float)input + info->offset) * info->scale); > break; > case 'f': { > -#if defined(__FLT16_MAX__) > +#if defined(FLT16_MAX) > union { > uint16_t u; > _Float16 f; One Sashiko issue: Does this unintentionally disable _Float16 support for all architectures? Since the tools build environment uses gnu11 compilation flags without explicitly defining __STDC_WANT_IEC_60559_TYPES_EXT__, FLT16_MAX is undefined across all architectures. This causes the preprocessor to skip this block entirely, causing the tool to always print for 16-bit float data, even on platforms where native support previously worked. If FLT16_MAX were actually defined, the compiler would still parse the _Float16 block and throw the same missing -msse2 compilation error mentioned in the commit message. Is there an alternative way to check for hardware support without completely disabling the feature? -- Kind regards, Joshua Crofts