From nobody Mon Apr 15 23:02:05 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4VJN3L0qwJz5HGxk; Mon, 15 Apr 2024 23:02:06 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4VJN3K6jLXz4s2q; Mon, 15 Apr 2024 23:02:05 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1713222125; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=OVBwp2J0VYJ1Xu/lAXU9cIoAhZqqnESYMQ+LrbQXsK8=; b=WWPusqiRfyv7V8wJto5nGkxH7Tqm6LN0+Rege7gALQCGDavLek+2FTNFpeCIQO03UVa52C iHeUFGlYtyFULaRPJHUOl/I/aS2S0+w+0r9nOC9cSaKd8zu69B2s/fyLvIiP9iIDC+bUc/ IhmRznfe7PSwoqZpiKk7i6HM7OsrrlXaOA3h1ymNyMnAJKF78ICqc/uy8XfzRKP62sVLKK krulLXVDBRwguwnvXELfURbtw7mu6V/MdhCmqlgiAinh1rWeEt7ryX7m3fwVMCPG6lR9ut VYWvgSwC450LTGgsB7HNVwAvCMp3rUiZV6QXlmcmxZBl5O/dvwdqWIpl3bJIwA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1713222125; a=rsa-sha256; cv=none; b=MsjsQdqB0J5utIb4D0IBWnCYEA9iXf0pMn6iG41NRpYMOrpzsruT9jkU8NvHHSAyla3W/8 S/+hgaMYBfXtIBAy0JbcAo/EwDZrpLTkY5VkOl7kWEnNCNIjNC2SblM5V9jRZgd1AkZgy5 pZoRPrV4EK94vzZWg2dB6SKLk/wD7/CrjFCJBNc4R4+YxQm/Q7GZnUIeW1RIYPHmPHHbfE ZRhl/Jm7ydjGHR4seimYhqfLI+mCWPgwvBY9r8lzMoYr6GLxHB4/9DJdvEAENZn2Rbj4lc yi2M+PldzHTkqkUoPEQmFhLyMdMIgGO8WZ5MhZkCzIwI6rVz//ftZjUSbix1YA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1713222125; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=OVBwp2J0VYJ1Xu/lAXU9cIoAhZqqnESYMQ+LrbQXsK8=; b=MQ6m0x/nbYQZvMBp3qHsJu6pGbhNgLqN0Y3betHURZ0lpX/tTIxm47CFB61Pp9Jo6NjMbE dQUk57dhEhnsMNmX12vkjuyM1sgLvHc5xEH3gxV4MVJabZpgLiwXAZBxuX5+rPN3YnnZ35 LFbmXFvfumYME/82LkgqMZab5DeQWYgh/+1jAYNfN5UKTYMZmGCCFAfwbnh45DTe+9ufBg 26gF1zpHZdKAHiMSBsZAMCcWgrGHYtlyi7W8dm3xepV5dOGQ0+UekPNl4Aeej7CgdVzN+w U1bybpt/UgJmvEAOr+uOFWzKhWQohoY8nG04R9ggx2dSqtp+mDkwzhTxnOAwHA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4VJN3K6K5zzJ4Y; Mon, 15 Apr 2024 23:02:05 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 43FN25ct080053; Mon, 15 Apr 2024 23:02:05 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 43FN25m0080050; Mon, 15 Apr 2024 23:02:05 GMT (envelope-from git) Date: Mon, 15 Apr 2024 23:02:05 GMT Message-Id: <202404152302.43FN25m0080050@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Warner Losh Subject: git: 770e04e65fbb - stable/14 - awk: revert upstream's attempt to disallow hex strings List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: imp X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 770e04e65fbbb8e8a21830fe043522907a1702c3 Auto-Submitted: auto-generated The branch stable/14 has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=770e04e65fbbb8e8a21830fe043522907a1702c3 commit 770e04e65fbbb8e8a21830fe043522907a1702c3 Author: Warner Losh AuthorDate: 2024-04-15 22:59:28 +0000 Commit: Warner Losh CommitDate: 2024-04-15 22:59:28 +0000 awk: revert upstream's attempt to disallow hex strings Upstream one-true-awk decided to disallow hex strings as numbers. This is in line with awk's behavior prior to C99, and allowed by the POSIX standard. The standard, however, allows them to be treated as numbers because that's what the standard said in the 2001 through 2004 editions. Since 2001, the nawk in FreeBSD has treated them as numbers, so restore that behavior, allowed by prior standards, but not the latest POSIX standard. A number of scripts in the FreeBSD tree depend on this interpretation, including scripts to build the kernel which had mysteriously started failing for some people and not others. By re-allowing 0x hex numbers, this fixes those scripts and restores POLA. Upstream issue: https://github.com/onetrueawk/awk/issues/126 Sponsored by: Netflix Reviewed by: kevans MFC After: asap due to regression alrady merged to stable Differential Revision: https://reviews.freebsd.org/D31199 Note: This is re-done in stable/14 because the release notes say 15 and newer will have this restriction, implying stable/14 will not, but the OTA 2nd edition merge neglected to have this, breaking kernel.bin in arm*. (cherry picked from commit d4d252c49976de33d0a2926df733744d0b8d95fa) --- contrib/one-true-awk/lib.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/contrib/one-true-awk/lib.c b/contrib/one-true-awk/lib.c index 0dac1f929cf2..e6fb99c744b5 100644 --- a/contrib/one-true-awk/lib.c +++ b/contrib/one-true-awk/lib.c @@ -886,9 +886,18 @@ bool is_valid_number(const char *s, bool trailing_stuff_ok, while (isspace((int) *s)) s++; +/* + * This test, while allowed by newer POSIX standards, represents a regression + * where hex strings were treated as numbers in nawk the whole time it has been + * in FreeBSD (since 2001). The POSIX 2001 through 2004 standards mandated this + * behavior and the current standard allows it. Deviate from upstream by restoring + * the prior FreeBSD behavior. + */ +#if 0 /* no hex floating point, sorry */ if (s[0] == '0' && tolower(s[1]) == 'x') return false; +#endif /* allow +nan, -nan, +inf, -inf, any other letter, no */ if (s[0] == '+' || s[0] == '-') {