🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: gnu.groff.bug
Article #74

\} at end of line sometimes elicits strange warning (groff -ww)

#74
From: James Clark
Date: Mon, 12 Oct 1992 08:04
46 lines
1833 bytes
   INPUT FILES:
	   .if 1 \{\
	   .nr x 1 \}

   COMMAND LINE: groff -ww

   DESCRIPTION OF INCORRECT BEHAVIOUR:
	   <standard input>:2: warning: `\}' where number expected

	   Is a warning really called for here?
	   Similarly for `.sp \}', etc.

If you don't want these warnings, you can disable them with
`-Wright-brace'.

`\}' behaves in a rather bizarre way: it disappears much later than
might be expected.  If you use `\}' in a place where a numeric
argument is expected, troff will behave as if an invalid argument had
been supplied rather than as if no argument had been supplied.  This
is true for both GNU troff and traditional troff.  Traditional troff
and GNU troff differ in their treatment of requests that have invalid,
optional arguments: traditional troff sometimes ignores the entire
request, sometimes behaves as if the invalid argument was missing, and
sometimes behaves as if the argument was zero; GNU troff usually
ignores the request (perhaps it would be better if it always treated
an invalid, optional argument as missing.)

For example, this

   .ps 10
   .ps 8
   .if 1 \{\
   .ps \}
   .tm \n(.s

will print `8' not `10'.

These problems can all be avoided by putting the `\}' on a separate
line:

   .if 1 \{\
   .   nr x 1
   .\}

James Clark
jjc@jclark.com
Technical Details
Message-ID: <9210120804.AA25171@jclark.com>
Path: arc1-ca.pugleaf.net!sparky!uunet!convex!linac!pacific.mps.ohio-state.edu!cis.ohio-state.edu!jclark.com!jjc
References: <9210080020.AA02141@farside.twinsun.com>

Show Full Headers
Complete Article Headers
Newsgroups: gnu.groff.bug
Path: arc1-ca.pugleaf.net!sparky!uunet!convex!linac!pacific.mps.ohio-state.edu!cis.ohio-state.edu!jclark.com!jjc
From: jjc@jclark.com (James Clark)
Subject: \} at end of line sometimes elicits strange warning (groff -ww)
Message-ID: <9210120804.AA25171@jclark.com>
Sender: gnulists@ai.mit.edu
Organization: GNUs Not Usenet
References: <9210080020.AA02141@farside.twinsun.com>
Distribution: gnu
Date: Mon, 12 Oct 1992 08:04:25 GMT
Approved: bug-groff@prep.ai.mit.edu
Lines: 48