home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1993 #1 / NN_1993_1.iso / spool / comp / lang / c / 19607 < prev    next >
Encoding:
Text File  |  1993-01-12  |  1.1 KB  |  32 lines

  1. Newsgroups: comp.lang.c
  2. Path: sparky!uunet!spool.mu.edu!darwin.sura.net!sgiblab!a2i!kpapai
  3. From: kpapai@rahul.net (Ken Papai)
  4. Subject: Re: should main be prototyped?
  5. Message-ID: <C0rnCq.D9o@rahul.net>
  6. Sender: news@rahul.net (Usenet News)
  7. Nntp-Posting-Host: bolero
  8. Organization: a2i network
  9. References: <1ivj3nINNa5v@shelley.u.washington.edu>
  10. Distribution: usa
  11. Date: Wed, 13 Jan 1993 00:14:49 GMT
  12. Lines: 18
  13.  
  14. (Charles Bass) writes:
  15. >Someone asked me if main should be prototyped today and I
  16. >couldn't answer because of the following conflict in my
  17. >prototyping habits:
  18. >1) All functions should be prototyped.
  19. >2) I've never seen a prototype for main. (not found grepping the
  20. >   .h files or in my 2 years of programming)
  21. >For code that should be ANSI/portable should a prototype be
  22. >used for main?
  23.  
  24. I say most definitely yes.  main() is a function, albeit in a 
  25. special category, but a function nonetheless.
  26.  
  27. I've seen code that calls main(), therefore it requires a prototype.
  28. Some compilers and lints will create your function prototypes for you.
  29. To prototype, or not to prototype -- there is no question!
  30. -- 
  31. Ken Papai <kpapai@rahul.net>
  32.