home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #31 / NN_1992_31.iso / spool / comp / lang / c / 19071 < prev    next >
Encoding:
Text File  |  1992-12-31  |  2.0 KB  |  44 lines

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