🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: gnu.groff.bug
Article #53

groff 1.06 nit: troff/input.cc sets char to 133

#53
From: Paul Eggert
Date: Thu, 03 Sep 1992 20:18
43 lines
1756 bytes
GROFF VERSION: 1.06

MACHINE: Sun Sparcstation 1

OS: SunOS 4.1.2

COMPILER: GCC 2.2.2 with local patches

INPUT FILES: none

COMMAND LINE: none

DESCRIPTION OF INCORRECT BEHAVIOUR:
groff 1.06 initializes a char variable with the value 133,
which strictly speaking isn't allowed on systems with signed chars,
where legal chars are in the range -128..127.

SUGGESTED FIX:
===================================================================
RCS file: troff/input.cc,v
retrieving revision 1.6
diff -c1 -r1.6 troff/input.cc
*** troff/input.cc	1992/08/25 15:02:53	1.6
--- troff/input.cc	1992/09/02 09:04:53
***************
*** 134,136 ****
  const int ESCAPE_E = 0204;
! const int LAST_PAGE_EJECTOR = 0205;
  const int ESCAPE_RIGHT_PARENTHESIS = 0206;
--- 134,137 ----
  const int ESCAPE_E = 0204;
! const char LAST_PAGE_EJECTOR_char = '\205'; // to avoid initialization overflow
! const int LAST_PAGE_EJECTOR = (unsigned char) LAST_PAGE_EJECTOR_char;
  const int ESCAPE_RIGHT_PARENTHESIS = 0206;
***************
*** 1810,1812 ****
    topdiv->set_ejecting();
!   static char buf[2] = { LAST_PAGE_EJECTOR, '\0' };
    input_stack::push(make_temp_iterator(buf));
--- 1811,1813 ----
    topdiv->set_ejecting();
!   static char buf[2] = { LAST_PAGE_EJECTOR_char, '\0' };
    input_stack::push(make_temp_iterator(buf));
Technical Details
Message-ID: <9209032018.AA27990@farside.twinsun.com>
Path: arc1-ca.pugleaf.net!sparky!uunet!cis.ohio-state.edu!twinsun.COM!eggert

Show Full Headers
Complete Article Headers
Newsgroups: gnu.groff.bug
Path: arc1-ca.pugleaf.net!sparky!uunet!cis.ohio-state.edu!twinsun.COM!eggert
From: eggert@twinsun.COM (Paul Eggert)
Subject: groff 1.06 nit: troff/input.cc sets char to 133
Message-ID: <9209032018.AA27990@farside.twinsun.com>
Sender: gnulists@ai.mit.edu
Organization: GNUs Not Usenet
Distribution: gnu
Date: Thu, 3 Sep 1992 20:18:30 GMT
Approved: bug-groff@prep.ai.mit.edu
Lines: 44