home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #20 / NN_1992_20.iso / spool / gnu / utils / bug / 1589 < prev    next >
Encoding:
Internet Message Format  |  1992-09-13  |  4.0 KB

  1. Path: sparky!uunet!elroy.jpl.nasa.gov!swrinde!zaphod.mps.ohio-state.edu!cis.ohio-state.edu!pdv2.fmr.maschinenbau.th-darmstadt.de!gnu
  2. From: gnu@pdv2.fmr.maschinenbau.th-darmstadt.de (GNU - Mutter aller PDVSoftNummern)
  3. Newsgroups: gnu.utils.bug
  4. Subject: indent-1.6 -troff : character constants
  5. Message-ID: <GNU.92Sep14010643@PDV2.fmr.maschinenbau.th-darmstadt.de>
  6. Date: 14 Sep 92 01:06:43 GMT
  7. Sender: gnulists@ai.mit.edu
  8. Distribution: gnu
  9. Organization: /usr/users/gnu/.organization
  10. Lines: 172
  11. Approved: bug-gnu-utils@prep.ai.mit.edu
  12.  
  13. GNU-indent-1.6 has been configured for SUN3 and was compiled
  14. with GCC-2.2.2 for SUN3. 
  15.  
  16. GNU-indent-1.6 does not handle character constants in a correct manner
  17. using "-troff" option. It generates wrong constants, or keeps sequence
  18. of characters with special meaning to "troff", which will generate
  19. everything else than desired.
  20.  
  21. Below follows a short C text, its translation to troff,
  22. and "config.status" of GNU-indent-1.6.
  23.  
  24.  
  25. best adams
  26.  
  27. Reply to "gnu@pdv2.fmr.maschinenbau.th-darmstadt.de"
  28.  
  29. ============================== log ============================================
  30. 22:43:10 pdv3 > cat stupid.c
  31. /* 
  32.  * A simple C - program to show
  33.  * bugs in indent-1.6 by FSF.
  34.  *
  35.  * It will generate bad 
  36.  * troff code both for 
  37.  * char constants 
  38.  * and quote ( "'", ascii code 0x24).
  39.  *
  40.  */
  41.  
  42. char digits[]={'1','2','3','4','5'};
  43.  
  44.  
  45. /* 
  46.  * control characters
  47.  */
  48.  
  49. char control_chars[]={'\n', '\r'};
  50.  
  51. /* 
  52.  * more tricky ones
  53.  */
  54.  
  55. char tricky_chars[]={'\000', '\007'};
  56.  
  57. /* 
  58.  * even more tricky
  59.  */
  60.  
  61. char more_tricky_chars[]={'\\', '\'', '\"'}; 
  62. 22:46:26 pdv3 > indent-1.6 -version
  63. GNU indent 1.6
  64. 22:46:40 pdv3 > indent-1.6 -v -troff -st stupid.c > stupid.nroff
  65. option: troff
  66. option: st
  67. 22:47:08 pdv3 > cat stupid.nroff
  68. .ds fB R
  69. .nr sB 11
  70. .ds fC I
  71. .nr sC 11
  72. .ds fL I
  73. .nr sL 13
  74. .ds fX I
  75. .nr sX 13
  76. .ds fS L
  77. .nr sS 11
  78. .ds fK B
  79. .nr sK 11
  80. .Fn "stupid.c"
  81. .*/
  82.  
  83. ./* 7p -1 0p
  84. A simple C - program to show
  85. bugs in indent-1.6 by FSF.
  86. It will generate bad
  87. troff code both for
  88. char constants
  89. and quote ( "'", ascii code 0x24).
  90.  
  91. .*/
  92. \h'|0p'\fBCHAR\fR 
  93. .De 14p+7p
  94. digits[] =
  95. \h'|0p'{`\f\fR, `\f\fR, `\f\fR, `\f\fR, `\f\fR};
  96.  
  97.  
  98. .*/
  99.  
  100. ./* 7p -1 0p
  101. Control characters
  102.  
  103. .*/
  104. \h'|0p'\fBCHAR\fR 
  105. .De 14p+7p
  106. control_chars[] =
  107. \h'|0p'{`\fL\\\fR, `\fL\\\fR};
  108.  
  109. .*/
  110.  
  111. ./* 7p -1 0p
  112. More tricky ones
  113.  
  114. .*/
  115. \h'|0p'\fBCHAR\fR 
  116. .De 14p+7p
  117. tricky_chars[] =
  118. \h'|0p'{`\fL\\\fR, `\fL\\\fR};
  119.  
  120. .*/
  121.  
  122. ./* 7p -1 0p
  123. Even more tricky
  124.  
  125. .*/
  126. \h'|0p'\fBCHAR\fR 
  127. .De 14p+7p
  128. more_tricky_chars[] =
  129. \h'|0p'{`\fL\\\\fR, `\fL\\\fR, `\fL\\\fR};
  130. There were 27 output lines and 4 comments
  131. (Lines with comments)/(Lines with code):  0.000
  132. 22:47:14 pdv3 > 
  133.  
  134. ================================= config.status ===============================
  135. #!/bin/sh
  136. # Generated automatically by configure.
  137. # Run this file to recreate the current configuration.
  138. # This directory was configured as follows:
  139. # configure --prefix=/usr/local/ --exec_prefix=/usr/local/
  140.  
  141. case "$1" in
  142.   -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r)
  143.   exec /bin/sh configure --prefix=/usr/local/ --exec_prefix=/usr/local/ ;;
  144. esac
  145.  
  146. trap 'rm -f zmakefile; exit 1' 1 3 15
  147. CC='gcc -O'
  148. CPP='${CC-cc} -E'
  149. INSTALL='/bin/install -c'
  150. INSTALL_PROGRAM='$(INSTALL)'
  151. INSTALL_DATA='$(INSTALL) -m 644'
  152. LIBOBJS=''
  153. LIBS=''
  154. srcdir='.'
  155. DEFS=' -DHAVE_UNISTD_H=1 -DDIRENT=1'
  156. prefix='/usr/local/'
  157. exec_prefix='/usr/local/'
  158. prsub='s,^prefix[     ]*=.*$,prefix = /usr/local/,
  159. s,^exec_prefix[     ]*=.*$,exec_prefix = /usr/local/,'
  160.  
  161. top_srcdir=$srcdir
  162. for file in zmakefile; do
  163.   srcdir=$top_srcdir
  164.   # Remove last slash and all that follows it.  Not all systems have dirname.
  165.   dir=`echo $file|sed 's,/[^/][^/]*$,,'`
  166.   if test "$dir" != "$file"; then
  167.     test "$top_srcdir" != . && srcdir=$top_srcdir/$dir
  168.     test ! -d $dir && mkdir $dir
  169.   fi
  170.   echo creating $file
  171.   rm -f $file
  172.   echo "# Generated automatically from `basename $file`.in by configure." > $file
  173.   sed -e "
  174. $prsub
  175. s,@CC@,$CC,g
  176. s,@CPP@,$CPP,g
  177. s,@INSTALL@,$INSTALL,g
  178. s,@INSTALL_PROGRAM@,$INSTALL_PROGRAM,g
  179. s,@INSTALL_DATA@,$INSTALL_DATA,g
  180. s,@LIBOBJS@,$LIBOBJS,g
  181. s,@LIBS@,$LIBS,g
  182. s,@srcdir@,$srcdir,g
  183. s,@DEFS@,$DEFS," $top_srcdir/${file}.in >> $file
  184. done
  185.