🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

2 total messages Started by GNU - Mutter aller PDVSoftNummer... Mon, 14 Sep 1992 01:06
indent-1.6 -troff : character constants
#837
Author: GNU - Mutter aller PDVSoftNummer...
Date: Mon, 14 Sep 1992 01:06
172 lines
4313 bytes
GNU-indent-1.6 has been configured for SUN3 and was compiled
with GCC-2.2.2 for SUN3. 

GNU-indent-1.6 does not handle character constants in a correct manner
using "-troff" option. It generates wrong constants, or keeps sequence
of characters with special meaning to "troff", which will generate
everything else than desired.

Below follows a short C text, its translation to troff,
and "config.status" of GNU-indent-1.6.


best adams

Reply to "gnu@pdv2.fmr.maschinenbau.th-darmstadt.de"
 
============================== log ============================================
22:43:10 pdv3 > cat stupid.c
/* 
 * A simple C - program to show
 * bugs in indent-1.6 by FSF.
 *
 * It will generate bad 
 * troff code both for 
 * char constants 
 * and quote ( "'", ascii code 0x24).
 *
 */

char digits[]={'1','2','3','4','5'};


/* 
 * control characters
 */

char control_chars[]={'\n', '\r'};

/* 
 * more tricky ones
 */

char tricky_chars[]={'\000', '\007'};

/* 
 * even more tricky
 */

char more_tricky_chars[]={'\\', '\'', '\"'}; 
22:46:26 pdv3 > indent-1.6 -version
GNU indent 1.6
22:46:40 pdv3 > indent-1.6 -v -troff -st stupid.c > stupid.nroff
option: troff
option: st
22:47:08 pdv3 > cat stupid.nroff
.ds fB R
.nr sB 11
.ds fC I
.nr sC 11
.ds fL I
.nr sL 13
.ds fX I
.nr sX 13
.ds fS L
.nr sS 11
.ds fK B
.nr sK 11
.Fn "stupid.c"
.*/

./* 7p -1 0p
A simple C - program to show
bugs in indent-1.6 by FSF.
It will generate bad
troff code both for
char constants
and quote ( "'", ascii code 0x24).

.*/
\h'|0p'\fBCHAR\fR 
.De 14p+7p
digits[] =
\h'|0p'{`\f\fR, `\f\fR, `\f\fR, `\f\fR, `\f\fR};


.*/

./* 7p -1 0p
Control characters

.*/
\h'|0p'\fBCHAR\fR 
.De 14p+7p
control_chars[] =
\h'|0p'{`\fL\\\fR, `\fL\\\fR};

.*/

./* 7p -1 0p
More tricky ones

.*/
\h'|0p'\fBCHAR\fR 
.De 14p+7p
tricky_chars[] =
\h'|0p'{`\fL\\\fR, `\fL\\\fR};

.*/

./* 7p -1 0p
Even more tricky

.*/
\h'|0p'\fBCHAR\fR 
.De 14p+7p
more_tricky_chars[] =
\h'|0p'{`\fL\\\\fR, `\fL\\\fR, `\fL\\\fR};
There were 27 output lines and 4 comments
(Lines with comments)/(Lines with code):  0.000
22:47:14 pdv3 > 

================================= config.status ===============================
#!/bin/sh
# Generated automatically by configure.
# Run this file to recreate the current configuration.
# This directory was configured as follows:
# configure --prefix=/usr/local/ --exec_prefix=/usr/local/

case "$1" in
  -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r)
  exec /bin/sh configure --prefix=/usr/local/ --exec_prefix=/usr/local/ ;;
esac

trap 'rm -f zmakefile; exit 1' 1 3 15
CC='gcc -O'
CPP='${CC-cc} -E'
INSTALL='/bin/install -c'
INSTALL_PROGRAM='$(INSTALL)'
INSTALL_DATA='$(INSTALL) -m 644'
LIBOBJS=''
LIBS=''
srcdir='.'
DEFS=' -DHAVE_UNISTD_H=1 -DDIRENT=1'
prefix='/usr/local/'
exec_prefix='/usr/local/'
prsub='s,^prefix[ 	]*=.*$,prefix = /usr/local/,
s,^exec_prefix[ 	]*=.*$,exec_prefix = /usr/local/,'

top_srcdir=$srcdir
for file in zmakefile; do
  srcdir=$top_srcdir
  # Remove last slash and all that follows it.  Not all systems have dirname.
  dir=`echo $file|sed 's,/[^/][^/]*$,,'`
  if test "$dir" != "$file"; then
    test "$top_srcdir" != . && srcdir=$top_srcdir/$dir
    test ! -d $dir && mkdir $dir
  fi
  echo creating $file
  rm -f $file
  echo "# Generated automatically from `basename $file`.in by configure." > $file
  sed -e "
$prsub
s,@CC@,$CC,g
s,@CPP@,$CPP,g
s,@INSTALL@,$INSTALL,g
s,@INSTALL_PROGRAM@,$INSTALL_PROGRAM,g
s,@INSTALL_DATA@,$INSTALL_DATA,g
s,@LIBOBJS@,$LIBOBJS,g
s,@LIBS@,$LIBS,g
s,@srcdir@,$srcdir,g
s,@DEFS@,$DEFS," $top_srcdir/${file}.in >> $file
done
indent-1.6 -troff : character constants
#855
Author: Joseph Arceneaux
Date: Tue, 15 Sep 1992 11:25
21 lines
1297 bytes
   From: gnu@pdv2.fmr.maschinenbau.th-darmstadt.de (GNU - Mutter aller PDVSoftNummern)
   Date: Mon, 14 Sep 1992 01:06:43 GMT

   GNU-indent-1.6 does not handle character constants in a correct manner
   using "-troff" option. It generates wrong constants, or keeps sequence
   of characters with special meaning to "troff", which will generate
   everything else than desired.

GNU indent doesn't really support -troff.  Ideally, indent should be
rewritten and provide support for TeX output.  If someone would like
to undertake this project, please send me email.

Joe

----
Joseph Arceneaux
Free Software Foundation
jla@ai.mit.edu                PO Box 460633
+1 415 285 9088               San Francisco, CA 94146

Help abolish software patents -- send mail for details.
Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads