Bug 154409 - indent(1) bug report
Summary: indent(1) bug report
Status: Closed FIXED
Alias: None
Product: Base System
Classification: Unclassified
Component: bin (show other bugs)
Version: Unspecified
Hardware: Any Any
: Normal Affects Only Me
Assignee: freebsd-bugs (Nobody)
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-01-31 06:50 UTC by Li
Modified: 2016-08-07 14:29 UTC (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Li 2011-01-31 06:50:06 UTC
I found two bugs of indnet(1).

How-To-Repeat: Here is a pieces of C codes:

/******************************************************************************/
/*
 * example.c
 */
/******************************************************************************/

void
example(void)
{
/* The first empty statement ";" indicates the first bug. */
/* Without this empty statement, indent(1) can handle the switch statement properly. */
/* The "case 1" will be wrong. */

	;

	switch (p_stage_3_parameter->s_3_mutation_method)
	{
	case 1:
		example_01();

		break;

	case 2:
		example_02();

		break;

	default:
		printf("Error.\n");

		break;

	}

	if ()
	{

	}
	else /* This comment indicates the second bug. */
	{
		/* A comment following an "else" statement always cause an error. */

	}

}

/******************************************************************************/

Here is my .indent.pro:

-TFILE
-Tfd_mask
-Tfd_set
-Tlinker_sym_tT
-Tu_char
-Tu_int
-Tu_long
-Tu_short
-TTAILQ_HEAD
-TTAILQ_ENTRY
-TLIST_HEAD
-TLIST_ENTRY
-TSTAILQ_HEAD
-TSTAILQ_ENTRY
-TSLIST_HEAD
-TSLIST_ENTRY
-bad
-bap
-bbb
-bc
-bl
-c81
-cd81
-cdb
-nce
-ci8
-cli0
-d0
-di8
-ndj
-ei
-nfc1
-nfcb
-i8
-ip8
-l140
-lc140
-ldi0
-lp
-npcs
-psl
-sc
-nsob
-nv
-nfbs

And I use gvim (I think this doesn't matter) to write C codes.
Comment 1 Pedro F. Giffuni freebsd_committer freebsd_triage 2016-08-07 14:29:52 UTC
The bugs here appear to have been fixed by r303484.