Path: utzoo!attcan!uunet!vsi!sullivan
From: sullivan@vsi.UUCP (Michael T Sullivan)
Newsgroups: comp.lang.c
Subject: Re: How do you document breakless cases
Summary: exits out of a switch
Keywords: break,case,switch
Message-ID: <739@vsi.UUCP>
Date: 30 Jun 88 23:35:16 GMT
References: <16607@tut.cis.ohio-state.edu>
Organization: V-Systems, Inc. -- Santa Ana, CA
Lines: 20

In article <16607@tut.cis.ohio-state.edu>, lvc@tut.cis.ohio-state.edu (Lawrence V. Cipriani) writes:

> 	1 /* fallthrough */
> 		if the last statement before a case isn't one of
> 			return
> 			exit
> 			abort
> 			etc.

return is different that exit and abort.  Lint knows that return isn't coming
back, wheras exit and abort are just functions.  I ran into this the other
day where my switch had all cases and default that returned and one that exited.
Lint complained about the one that exited with a "function has return and
return(e)" type of message.  I put a /*NOTREACHED*/ after the exit and lint
was much happier.

-- 
Michael Sullivan			{uunet|attmail}!vsi!sullivan
V-Systems, Inc.  Santa Ana, CA		sullivan@vsi.com
ons, workstations, workstations, workstations, workstations, workstations, work