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

  1. Path: sparky!uunet!cs.utexas.edu!asuvax!ncar!noao!amethyst!organpipe.uug.arizona.edu!news
  2. From: dave@cs.arizona.edu (Dave Schaumann)
  3. Newsgroups: comp.lang.c
  4. Subject: Re: Parameter passing & data abstraction
  5. Message-ID: <1993Jan1.002606.13612@organpipe.uug.arizona.edu>
  6. Date: 1 Jan 93 00:26:06 GMT
  7. References: <1992Dec30.184135.1963@organpipe.uug.arizona.edu> <24524@alice.att.com>
  8. Sender: news@organpipe.uug.arizona.edu
  9. Reply-To: dave@cs.arizona.edu (Dave Schaumann)
  10. Organization: University of Arizona
  11. Lines: 61
  12. In-Reply-To: bs@alice.att.com (Bjarne Stroustrup)
  13.  
  14. In article <24524@alice.att.com>, bs@alice (Bjarne Stroustrup) writes:
  15. >
  16. >
  17. >dave@cs.arizona.edu (Dave Schaumann @ University of Arizona) writes
  18. >
  19. > [I complained about the large size executables g++ produces]
  20. >
  21. >That cannot be a C++ problem. For
  22. >
  23. >    #include <stdio.h>
  24. >
  25. >    main() { printf("Hello, World\n"); }
  26. >
  27. >I get 
  28. >
  29. >    text    data    bss    dec    hex
  30. >    12288    6144    7624    26056    65c8
  31. >when compiling as a C++ program, and
  32. >
  33. >    text    data    bss    dec    hex
  34. >    12288    6144    7612    26044    65bc
  35.  
  36. OK, fair enough.  Here's what I get:
  37.  
  38. Machine    gcc size    g++ size  (size in bytes)
  39. -------    --------    --------
  40. Sequent      18085       23882
  41. Sun 4        24576      110490(!)
  42.  
  43. >when compiling as a C program. Changing the example to use
  44. >specific C++ facilities
  45. >    
  46. >    #include <iostream.h>
  47. >
  48. >    main() { cout << "Hello, World\n"; }
  49. >
  50. >I get
  51. >
  52. >    text    data    bss    dec    hex
  53. >    17408    2048    0    19456    4c00
  54.  
  55. I get 175759 on the Sequent, and 285202 on the Sun.
  56.  
  57. >Ofcourse G++ may be different, but that difference ought to
  58. >show up in GNU C also, then
  59.  
  60. I spoke to the person responsible for maintaining gcc and g++ at our site,
  61. and he said
  62.  
  63. # g++ 1.40 needs to use the GNU loader, to resolve the munged function names
  64. # and do creator/destructor calls.  GNU ld doesn't grok dynamic libraries, so
  65. # you end up binding a large portion of libc (and, in your case, libg++) into
  66. # the binary.
  67.  
  68. Yes, we are still using 1.40 :-( But he also said a new version is scheduled
  69. to be installed "almost immediately".  The only other option is some cfront-
  70. like program called CC, but (at least the version we have) is so hoplessly
  71. brain-damaged as to be unusable.
  72.  
  73. -- 
  74. Hey, everybody -- somebody said `mattress' to Mr. Lambert!  TWICE!
  75.