home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #19 / NN_1992_19.iso / spool / comp / lang / cplus / 13220 < prev    next >
Encoding:
Text File  |  1992-09-02  |  1.6 KB  |  40 lines

  1. Newsgroups: comp.lang.c++
  2. Path: sparky!uunet!munnari.oz.au!cs.mu.OZ.AU!munta.cs.mu.OZ.AU!fjh
  3. From: fjh@munta.cs.mu.OZ.AU (Fergus James HENDERSON)
  4. Subject: Re: Turbo C++, function prototypes
  5. Message-ID: <9224705.23705@mulga.cs.mu.OZ.AU>
  6. Sender: news@cs.mu.OZ.AU
  7. Organization: Computer Science, University of Melbourne, Australia
  8. References: <1992Aug31.181755.13060@hou.amoco.com> <2262@bigfoot.first.gmd.de> <1992Sep1.160816.10309@lclark.edu> <1992Sep2.162728.11201@taumet.com>
  9. Date: Wed, 2 Sep 1992 19:13:23 GMT
  10. Lines: 28
  11.  
  12. steve@taumet.com (Steve Clamage) writes:
  13.  
  14. >If you write, for example,
  15. >    void main(){ }
  16. >The compiler is obligated to diagnose an error in C and C++.
  17.  
  18. Are you sure? I've just tested three supposably ANSI-compliant C compilers
  19. and NONE of them diagnose an error (or even a warning!). 
  20.  
  21. The compilers were
  22.     gcc -ansi -pedantic -Wall    version 2.2.2 for mips-sgi-irix
  23.     cc -ansi -pedantic -fullwarn    "MIPS ucode C compiler" on an sgi-irix
  24.     tcc -P- -A -w            Turbo C++ 1.00 (C compiler, not C++)
  25.  
  26. I also tested three C++ compilers, and got one error and one warning.
  27.  
  28.     g++ -ansi -pedantic -Wall    version 2.2.2 for mips-sgi-irix
  29.         Warning: return type for main changed to integer type
  30.     CC -ansi +p +w             Cfront 2.0, using the above cc
  31.         (No diagnostic)
  32.     tcc -P+ -A -w            Turbo C++ 1.00 (C++ compiler)
  33.         Error test.c 1: main must have a return type of int
  34.  
  35. -- 
  36. Fergus Henderson             fjh@munta.cs.mu.OZ.AU      
  37. This .signature virus is a self-referential statement that is true - but 
  38. you will only be able to consistently believe it if you copy it to your own
  39. .signature file!
  40.