From nobody@FreeBSD.org  Mon Jan 31 06:41:11 2011
Return-Path: <nobody@FreeBSD.org>
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 197CA106564A
	for <freebsd-gnats-submit@FreeBSD.org>; Mon, 31 Jan 2011 06:41:11 +0000 (UTC)
	(envelope-from nobody@FreeBSD.org)
Received: from red.freebsd.org (red.freebsd.org [IPv6:2001:4f8:fff6::22])
	by mx1.freebsd.org (Postfix) with ESMTP id 0ABD98FC08
	for <freebsd-gnats-submit@FreeBSD.org>; Mon, 31 Jan 2011 06:41:11 +0000 (UTC)
Received: from red.freebsd.org (localhost [127.0.0.1])
	by red.freebsd.org (8.14.4/8.14.4) with ESMTP id p0V6fACL059054
	for <freebsd-gnats-submit@FreeBSD.org>; Mon, 31 Jan 2011 06:41:10 GMT
	(envelope-from nobody@red.freebsd.org)
Received: (from nobody@localhost)
	by red.freebsd.org (8.14.4/8.14.4/Submit) id p0V6fAqH059053;
	Mon, 31 Jan 2011 06:41:10 GMT
	(envelope-from nobody)
Message-Id: <201101310641.p0V6fAqH059053@red.freebsd.org>
Date: Mon, 31 Jan 2011 06:41:10 GMT
From: Li <fender0107401@gmail.com>
To: freebsd-gnats-submit@FreeBSD.org
Subject: Indent bug report
X-Send-Pr-Version: www-3.1
X-GNATS-Notify:

>Number:         154409
>Category:       bin
>Synopsis:       indent(1) bug report
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    freebsd-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Mon Jan 31 06:50:06 UTC 2011
>Closed-Date:    
>Last-Modified:  Mon Jan 31 08:11:24 UTC 2011
>Originator:     Li
>Release:        8.0 release
>Organization:
>Environment:
FreeBSD PC-686.Workstation 8.0-RELEASE-p5 FreeBSD 8.0-RELEASE-p5 #4: Fri Oct 15 17:57:04 CST 2010     root@PC-686.Workstation:/usr/obj/usr/src/sys/MYKERNEL  amd64
>Description:
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.
>Fix:


>Release-Note:
>Audit-Trail:
>Unformatted:
