From nobody Sat Jun 01 15:18:15 2024 X-Original-To: dev-commits-src-main@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 4Vs3XS1j2gz5N31s; Sat, 01 Jun 2024 15:18:16 +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 4Vs3XS0LW8z4Lgd; Sat, 1 Jun 2024 15:18:16 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1717255096; 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=l26+awNYMIQKFIi2TzmvpnfBh/pcuE9lYA3CB5qxUZY=; b=dPZ8/i+MZPVJdlh85pz5CEoS9vsd1qDRK3/fcwSAtfeRLWMwkZuoQH19Qa4eg94wbfoY/0 fsW0E1vVNxX7zcx3Sj5oQakiizc2rxLPo/gW9QrQyOswb/zc2IwEobX0umTrOZCdD9YOXl ciMrxH25YMC9wzcb0FyLg4n6hPET+1+YX/xpiyemo+CYsLIxkl/QjZiqjNKrALJmho2ezV HJrUFxT4CO5HC/S+IIweGjuEI4On+iZZ6Z/OgsC2ZldD94mKEMXcckdclOWeqI97pXXqRl 7j1Ywy5tZy79m5plU9egHuAZfQZ8UvXCPU9pKfUtfkJT1KxADHmtmp6+WRCOQQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1717255096; a=rsa-sha256; cv=none; b=Y/cGTqSVDOGJ7QFmwo0Tq0CAxV0v7HoJA6wXDpS495WaN38zAaccUc5Zzmr8CaMF3/8QFy ucMrcSlkwD4BZXXGh9zjYpw8OAxaYi7TK2/5/fHCNRUgFuVXQYGVflDiCYbQngLwNlTOmw LpDYyJTIw0+oTN5k6wrmS4YZ69dz211JVn7H6y8+LFXPVmp0kWoikM6F38SrQxpcfeHhQ1 GG+cN8VL8pcVYMESJ9AIOEcLqpzGydBgudyz8vn81hKLIMSCWSdLTHYoSC5Exj/k7f9Moj n1T5TPATGTCPkQiHnsiaRaJh+DVVgWWMJ6JcGxuDlCJtUAjSrbEXAMoOCwZj+g== 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=1717255096; 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=l26+awNYMIQKFIi2TzmvpnfBh/pcuE9lYA3CB5qxUZY=; b=Aei1UGQPSDgjpRbEYLAz5hR6jshyxP1BoiyZzhLKCZ+azbtS34+e+cG57O2CsM4dVFUYcW PKPtYEUzJCiG6BT23xAuVHRGTCZy10ZOcH7D5UDJjiuowidbaW4Me1BLAgMBZDMYgsaTc/ 56hfhucrv95S87anytKeS4cYPrvT8sJanSeViOu9/jHJvf1iExc2OkuTLmU4Ri2gs2g5d1 6PkQW3BNNIdM2/+GYVjA61IV4o2I7hDcDL05Tw2fZEUhatemsgb7OYibP7ActGAHNELpTI +y34LKqDL6kUjIp4c/itpv3rM0/6MLJdhRSj5EOxkPtvd1ZJ/z6a9QWlkxTv0Q== 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 4Vs3XR71lbz1C1y; Sat, 1 Jun 2024 15:18:15 +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 451FIFvn063064; Sat, 1 Jun 2024 15:18:15 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 451FIFuF063061; Sat, 1 Jun 2024 15:18:15 GMT (envelope-from git) Date: Sat, 1 Jun 2024 15:18:15 GMT Message-Id: <202406011518.451FIFuF063061@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Mark Johnston Subject: git: 4bddff0833d3 - main - libdtrace: Work around a warning from flex List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: markj X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 4bddff0833d3efee77a099b3ef447fbae1e63d21 Auto-Submitted: auto-generated The branch main has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=4bddff0833d3efee77a099b3ef447fbae1e63d21 commit 4bddff0833d3efee77a099b3ef447fbae1e63d21 Author: Mark Johnston AuthorDate: 2024-06-01 15:16:26 +0000 Commit: Mark Johnston CommitDate: 2024-06-01 15:16:26 +0000 libdtrace: Work around a warning from flex When compiling dt_lex.l, flex produces warnings of the form: dt_lex.l:413: warning, trailing context made variable due to preceding '|' action dt_lex.l:412: warning, dangerous trailing context dt_lex.l:412: warning, dangerous trailing context Here, trailing context refers to the use of "$", which expands to "/\n". The meaning behind these warnings is described in the first two paragraphs of the flex manual's DEFICIENCIES/BUGS section: Some trailing context patterns cannot be properly matched and generate warning messages ("dangerous trailing context"). These are patterns where the ending of the first part of the rule matches the beginning of the second part, such as "zx*/xy*", where the 'x*' matches the 'x' at the beginning of the trailing context. (Note that the POSIX draft states that the text matched by such patterns is undefined.) For some trailing context rules, parts which are actually fixed-length are not recognized as such, leading to the above mentioned performance loss. In particular, parts using '|' or {n} (such as "foo{3}") are always considered variable-length. Here, the warnings appear to be bogus in this case. The lexer has no problem matching either of the referenced patterns, e.g., printf("foobar or # 1 "asdfasdf Introduce a small amount of code duplication to silence the warning. MFC after: 2 weeks --- cddl/contrib/opensolaris/lib/libdtrace/common/dt_lex.l | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cddl/contrib/opensolaris/lib/libdtrace/common/dt_lex.l b/cddl/contrib/opensolaris/lib/libdtrace/common/dt_lex.l index d50369bb57c9..756a48b9c45f 100644 --- a/cddl/contrib/opensolaris/lib/libdtrace/common/dt_lex.l +++ b/cddl/contrib/opensolaris/lib/libdtrace/common/dt_lex.l @@ -407,7 +407,7 @@ if (yypcb->pcb_token != 0) { {RGX_FP} yyerror("floating-point constants are not permitted\n"); -\"{RGX_STR}$ | +\"{RGX_STR}$ xyerror(D_STR_NL, "newline encountered in string literal"); \"{RGX_STR}$ xyerror(D_STR_NL, "newline encountered in string literal"); \"{RGX_STR}\" |