Skip site navigation (1)Skip section navigation (2)


| raw e-mail | index | archive | help
OK. Wasn't sure, but you're comments remove all doubt in my mind. will fix.

Warner

--000000000000b1cf4d061a00a59f
Content-Type: text/html; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr"><div dir=3D"ltr"></div><br><div class=3D"gmail_quote"><div=
 dir=3D"ltr" class=3D"gmail_attr">On Mon, Jun 3, 2024 at 12:19=E2=80=AFPM J=
essica Clarke &lt;<a href=3D"mailto:jrtc27@freebsd.org">jrtc27@freebsd.org<=
/a>&gt; wrote:<br></div><blockquote class=3D"gmail_quote" style=3D"margin:0=
px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">O=
n 3 Jun 2024, at 19:14, Warner Losh &lt;imp@FreeBSD.org&gt; wrote:<br>
&gt; <br>
&gt; The branch main has been updated by imp:<br>
&gt; <br>
&gt; URL: <a href=3D"https://cgit.FreeBSD.org/src/commit/?id=3D5dda778db634=
07214394c3cf63fb1312a4981024" rel=3D"noreferrer" target=3D"_blank">https://=
cgit.FreeBSD.org/src/commit/?id=3D5dda778db63407214394c3cf63fb1312a4981024<=
/a><br>
&gt; <br>
&gt; commit 5dda778db63407214394c3cf63fb1312a4981024<br>
&gt; Author:=C2=A0 =C2=A0 =C2=A0Dapeng Gao &lt;<a href=3D"mailto:dg612@cam.=
ac.uk" target=3D"_blank">dg612@cam.ac.uk</a>&gt;<br>
&gt; AuthorDate: 2024-06-03 17:30:52 +0000<br>
&gt; Commit:=C2=A0 =C2=A0 =C2=A0Warner Losh &lt;imp@FreeBSD.org&gt;<br>
&gt; CommitDate: 2024-06-03 18:14:10 +0000<br>
&gt; <br>
&gt;=C2=A0 =C2=A0 Use correct function declaration for yyerror<br>
&gt; <br>
&gt;=C2=A0 =C2=A0 According to the POSIX standard at<br>
&gt;=C2=A0 =C2=A0 <a href=3D"https://pubs.opengroup.org/onlinepubs/96999197=
99/utilities/yacc.html" rel=3D"noreferrer" target=3D"_blank">https://pubs.o=
pengroup.org/onlinepubs/9699919799/utilities/yacc.html</a><br>
&gt;=C2=A0 =C2=A0 `yyerror` should return `int`. Add unreachable since errx=
 never returns.<br>
&gt; <br>
&gt;=C2=A0 =C2=A0 Reviewed by:=C2=A0 =C2=A0 imp, kib<br>
&gt;=C2=A0 =C2=A0 Differential Revision:=C2=A0 <a href=3D"https://reviews.f=
reebsd.org/D45447" rel=3D"noreferrer" target=3D"_blank">https://reviews.fre=
ebsd.org/D45447</a><br>
&gt; ---<br>
&gt; usr.sbin/config/config.y | 6 ++++--<br>
&gt; 1 file changed, 4 insertions(+), 2 deletions(-)<br>
&gt; <br>
&gt; diff --git a/usr.sbin/config/config.y b/usr.sbin/config/config.y<br>
&gt; index a5a9e1546c36..148959fbff2e 100644<br>
&gt; --- a/usr.sbin/config/config.y<br>
&gt; +++ b/usr.sbin/config/config.y<br>
&gt; @@ -88,7 +88,7 @@ int maxusers;<br>
&gt; <br>
&gt; #define ns(s) strdup(s)<br>
&gt; int include(const char *, int);<br>
&gt; -void yyerror(const char *s);<br>
&gt; +int yyerror(const char *s);<br>
&gt; int yywrap(void);<br>
&gt; <br>
&gt; static void newdev(char *name);<br>
&gt; @@ -299,11 +299,13 @@ NoDevice:<br>
&gt; <br>
&gt; %%<br>
&gt; <br>
&gt; -void<br>
&gt; +int<br>
&gt; yyerror(const char *s)<br>
&gt; {<br>
&gt; <br>
&gt; errx(1, &quot;%s:%d: %s&quot;, yyfile, yyline + 1, s);<br>
&gt; + __unreachable();<br>
&gt; + return (0);<br>
&gt; }<br>
<br>
This should just be:<br>
<br>
int<br>
yyerror(const char *s)<br>
{<br>
=C2=A0 =C2=A0 =C2=A0 =C2=A0 errx(1, &quot;%s:%d: %s&quot;, yyfile, yyline +=
 1, s);<br>
}<br>
<br>
errx is __dead2. See bin/expr/expr.y for an example of this in-tree.<br></b=
lockquote><div><br></div><div>OK. Wasn&#39;t sure, but you&#39;re comments =
remove all doubt in my mind. will fix.</div><div><br></div><div>Warner=C2=
=A0</div></div></div>

--000000000000b1cf4d061a00a59f--



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?>