From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp1.rz.uni-karlsruhe.de (Debian-exim@smtp1.rz.uni-karlsruhe.de [129.13.185.217]) by krisdoz.my.domain (8.14.3/8.14.3) with ESMTP id o8QDEarU024104 for ; Sun, 26 Sep 2010 09:14:38 -0400 (EDT) Received: from hekate.usta.de (asta-nat.asta.uni-karlsruhe.de [172.22.63.82]) by smtp1.rz.uni-karlsruhe.de with esmtp (Exim 4.63 #1) id 1Ozr3q-0008Vs-ML; Sun, 26 Sep 2010 15:14:34 +0200 Received: from donnerwolke.usta.de ([172.24.96.3]) by hekate.usta.de with esmtp (Exim 4.71) (envelope-from ) id 1Ozr3q-0002vK-L2 for tech@mdocml.bsd.lv; Sun, 26 Sep 2010 15:14:34 +0200 Received: from iris.usta.de ([172.24.96.5] helo=usta.de) by donnerwolke.usta.de with esmtp (Exim 4.69) (envelope-from ) id 1Ozr3q-0006pR-Ji for tech@mdocml.bsd.lv; Sun, 26 Sep 2010 15:14:34 +0200 Received: from schwarze by usta.de with local (Exim 4.71) (envelope-from ) id 1Ozr3q-0000fO-AL for tech@mdocml.bsd.lv; Sun, 26 Sep 2010 15:14:34 +0200 Date: Sun, 26 Sep 2010 15:14:33 +0200 From: Ingo Schwarze To: tech@mdocml.bsd.lv Subject: Re: tweak message "scope open on exit" Message-ID: <20100926131433.GA3502@iris.usta.de> References: <20100923225445.GG11894@iris.usta.de> <4C9F0EA1.3080302@bsd.lv> X-Mailinglist: mdocml-tech Reply-To: tech@mdocml.bsd.lv MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <4C9F0EA1.3080302@bsd.lv> User-Agent: Mutt/1.5.20 (2009-06-14) Hi Kristaps, Kristaps Dzonsons wrote on Sun, Sep 26, 2010 at 11:13:05AM +0200: > Ingo Schwarze wrote: >> in mdoc(7), if an explicit scope is still open at the end of an input >> file, that's FATAL. I really don't see why, it's trivial to just >> close out the block and proceed to rendering the file. >> >> On the other hand, in man(7), if an explicit scope is still open at >> the end of an input file, that's merely a WARNING. I regard that >> as dangerous, because an unclosed block probably means that either: [...] >> >> As i see it, that's a typical case of a non-fatal ERROR: >> We can render, but probably infomation is missing or the >> structure is seriously mangled. >> >> Besides, why not use the same error type for mdoc(7) and man(7)? >> >> And finally, since we do know that the error is non-fatal, >> there is no need to check the return value of the msg function. > Ingo, this looks good. At first I dithered for a while about > returning 0 to mdoc_endparse(), but because the error is non-fatal, > your reasoning is sound and I agree. Right, that is the good news about mdoc_nmsg() and friends, basically about all messaging functions based on main.c, function mmsg(): These functions now cannot fail any more, and we know the return value beforehand, so in the long run, we can drop all the return value tests and finally make mmsg() void. That will shorten much of the code and make it easier on the eye. I don't see the pressing need for big churn right now and rather plan to simplify what needs to be touched anyway, as we go. > Can you fix up the WARNING->ERROR logic in libman, too? I don't think anything more needs to be done, in particular i can't think of anything to change in man*.c. As far as i understand, just moving the entry in the lists in mandoc.h and main.c does the trick for man. Or am i missing anything? Yours, Ingo -- To unsubscribe send an email to tech+unsubscribe@mdocml.bsd.lv