home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.lang.c
- Path: sparky!uunet!zaphod.mps.ohio-state.edu!cs.utexas.edu!csc.ti.com!tilde.csc.ti.com!mksol!mccall
- From: mccall@mksol.dseg.ti.com (fred j mccall 575-3539)
- Subject: Re: Function definition style
- Message-ID: <1992Dec31.141035.24200@mksol.dseg.ti.com>
- Organization: Texas Instruments Inc
- References: <1992Dec30.223045.29467@news2.cis.umn.edu>
- Date: Thu, 31 Dec 1992 14:10:35 GMT
- Lines: 33
-
- In <1992Dec30.223045.29467@news2.cis.umn.edu> wright@staff.tc.umn.edu (Mark Wright) writes:
-
- >Is there any good reason not to use the following style for defining
- >functions:
-
- >type function_name( varname1, varname2, varname3 )
-
- >type varname1;
- >type varname2;
- >type varname3;
-
- >I try to use the style in ansi k&r, but I notice that others are using this
- >style and I assume they aren't all using pre-ansi compilers. My problem is
- >that to use Brief's function listing command the end paren must be on the same
- >line as the function name, which is difficult to do using k&r 2 style if the
- >function needs several structs as parameters. Besides, it's easier to
- >document function parameters with k&r 1 style. Is there any good reason
- >for me to continue to use k&r 2 style (other than the fact that it makes
- >the function declaration in a .h file a simple cut and paste operation)?
-
- I just like the way the old declarations LOOK -- it's nice and
- consistent with every other variable declaration in the way that it
- declares the parameters. However, because ANSI has decreed (for what
- seem good and sufficient reasons, but I still don't like it) that the
- 'classic' declarations will not type-check the parameters even if
- there is a prototype somewhere which is visible, I try to force myself
- to use the new-style declarations when the compiler will support them.
-
- --
- "Insisting on perfect safety is for people who don't have the balls to live
- in the real world." -- Mary Shafer, NASA Ames Dryden
- ------------------------------------------------------------------------------
- Fred.McCall@dseg.ti.com - I don't speak for others and they don't speak for me.
-