Article View: gnu.utils.bug
Article #1012Bugs in indent 1.6
From: Andreas Schwab
Date: Tue, 06 Oct 1992 14:47
Date: Tue, 06 Oct 1992 14:47
75 lines
3054 bytes
3054 bytes
There are (atleast :-) three bugs in indent 1.6:
* args.c (struct pro pro, !BERKLEY_DEFAULTS): default values for -fc1
and -nfc1 doesn't correspondent with the -gnu setting
* io.c (read_stdin): pointer into stdinptr.data must be relocated each
time stdinptr.data is reallocated
* indent.c (indent):
`sizeof (char)' is read by `lexi' as ident, lparen, decl, rparen in the
following example (`decl' should be `ident', i think):
----------- test.c
f ()
{
do
g ();
while (sizeof (char));
}
----------
Output of: indent test.c -st
----------
f ()
{
do
g ();
while (sizeof (char));
/**INDENT** Error@6: Stmt nesting error. */
}
/**INDENT** Error@7: Stuff missing from end of file. */
----------
With the patch in indent.c this error disappears.
diff -u2r orig/args.c ./args.c
--- orig/args.c Mon Aug 10 21:32:22 1992
+++ ./args.c Tue Aug 25 20:56:20 1992
@@ -317,5 +317,5 @@
{"fbx", PRO_FONT, 0, ONOFF_NA, (int *) &boxcomf, &exp_fbx},
{"fb", PRO_FONT, 0, ONOFF_NA, (int *) &bodyf, &exp_fb},
- {"fc1", PRO_BOOL, true, ON, &format_col1_comments, &exp_fc1},
+ {"fc1", PRO_BOOL, false, ON, &format_col1_comments, &exp_fc1},
{"fca", PRO_BOOL, false, ON, &format_comments, &exp_fca},
{"fc", PRO_FONT, 0, ONOFF_NA, (int *) &scomf, &exp_fc},
@@ -354,5 +354,5 @@
{"neei", PRO_BOOL, false, OFF, &extra_expression_indent, &exp_eei},
{"nei", PRO_BOOL, true, OFF, &else_if, &exp_ei},
- {"nfc1", PRO_BOOL, true, OFF, &format_col1_comments, &exp_fc1},
+ {"nfc1", PRO_BOOL, false, OFF, &format_col1_comments, &exp_fc1},
{"nfca", PRO_BOOL, false, OFF, &format_comments, &exp_fca},
{"nip", PRO_SETTINGS, 0, ONOFF_NA, (int *) "-ip0\0", &exp_nip},
diff -u2r orig/indent.c ./indent.c
--- orig/indent.c Wed Aug 19 23:32:28 1992
+++ ./indent.c Sat Oct 3 16:23:58 1992
@@ -573,4 +573,5 @@
if (parser_state_tos->last_token == decl
|| (parser_state_tos->last_token == ident
+ && parser_state_tos->last_rw != rw_sizeof
&& parser_state_tos->last_rw != rw_return))
parser_state_tos->noncast_mask |=
diff -u2r orig/io.c ./io.c
--- orig/io.c Sat Aug 15 00:09:16 1992
+++ ./io.c Tue Aug 25 21:32:58 1992
@@ -488,7 +488,7 @@
stdinptr.data = (char *) xmalloc (size + 1);
stdinptr.size = 0;
- p = stdinptr.data;
do
{
+ p = stdinptr.data + stdinptr.size;
while (stdinptr.size < size)
{
--
Andreas Schwab
schwab@ls5.informatik.uni-dortmund.de
Technical Details
Message-ID:
<9210061247.AA28760@lamothe.informatik.uni-dortmund.de>Path:
arc1-ca.pugleaf.net!sparky!uunet!europa.asd.contel.com!darwin.sura.net!zaphod.mps.ohio-state.edu!cis.ohio-state.edu!lamothe.informatik.uni-dortmund.de!schwabShow Full Headers
Complete Article Headers
Newsgroups: gnu.utils.bug Path: arc1-ca.pugleaf.net!sparky!uunet!europa.asd.contel.com!darwin.sura.net!zaphod.mps.ohio-state.edu!cis.ohio-state.edu!lamothe.informatik.uni-dortmund.de!schwab From: schwab@lamothe.informatik.uni-dortmund.de (Andreas Schwab) Subject: Bugs in indent 1.6 Message-ID: <9210061247.AA28760@lamothe.informatik.uni-dortmund.de> Sender: gnulists@ai.mit.edu Reply-To: schwab@ls5.informatik.uni-dortmund.de (Andreas Schwab) Organization: GNUs Not Usenet Distribution: gnu Date: Tue, 6 Oct 1992 14:47:01 GMT Approved: bug-gnu-utils@prep.ai.mit.edu Lines: 76