Re: About Visual C++ 2005 Express Edition



Keith Thompson wrote:
jacob navia <jacob@xxxxxxxxxxxxxxxx> writes:

Richard Heathfield wrote:

[...]

Here's a small source file, which should show up the overhead of
various compilers quite well:
#include <stdio.h>
int main(void)
{
puts("Hello world");
return 0;
}
Here are the executable image sizes, in bytes (implementations with
"C++" in their title were invoked in C mode!):
gcc 2.81 for DOS: 92403
Visual C++ 5.0: 81408
Borland C++ 5.3: 55296
Borland C++ 5.6: 50688
Visual C++ 2005 Express Edition: 40960
gcc 2.95.3 for Linux: 34686
Visual C++ 6.0: 28672
Visual C++ 1.5: 5699
Turbo C++ 1.01: 4760
I tried to download lcc-win32 for comparison purposes, but the main
site's download link was bad, and the backup site screamed "bad
gateway" at me, so I guess that comparison will have to wait for
some other day.


Yes, virginia.edu is down

My data point is
lcc-win32 3104 bytes

compilation options
lc -O thello.c -s

But a more realistic example is:
#include <stdio.h>
int main(void)
{
printf("Hello world");
return 0;
}

This produces a code of 42 283 bytes (statically linked libc)
With dynamically linked libc we go down to 8152 bytes.


But that's not a useful comparison unless you have sizes for *the same
program* for other compilers.


Heathfield's sample used puts. Puts is MUCH smaller than printf OF COURSE.

I just showed a more realistical example. Even with all printf, 8K
is very good in Heathfield's list. Using puts() I am the smallest.


The code of printf is very bulky since needs an extended precision
library to correctly print denormal floating point numbers with all
the required precision. This is one of the few printfs that gets it
right, together with gcc's printf.


gcc has no printf; gcc is a compiler, not a complete implementation.
It uses whatever runtime library is provided by the operating system.
Do you mean glibc's printf?


Obvious. Technically you are right, it's glibc's printf
.



Relevant Pages

  • Re: Purchase microcontroller dev. kit
    ... Even on compilers which don't support it directly, the way to deal with code like that is clearly explained in user manuals and FAQs. ... no one doing embedded development on a small microcontroller would write code like that anyway - using printf is a sure sign you don't know what you are doing. ... Having a command line interface is also ...
    (sci.electronics.design)
  • Re: Convert output from MD5 to printable ascii
    ... I presume you would first confirm that the use of puts() doesn't ... I don't know what quality of implementations you are used to. ... All the compilers I use basically do link these seperately. ... reason is that printf is a gargantuan link-in in comparison to puts. ...
    (comp.lang.c)
  • Re: Why do i get runtime error ?
    ... I get runtime error for the above code. ... it's because you're not honest with printf(). ... some compilers warn you for e.g. ... But it can only do that if it gets a format string that is known ...
    (comp.lang.c)
  • Re: About Visual C++ 2005 Express Edition
    ... Here are the executable image sizes, in bytes (implementations with ... program* for other compilers. ... gcc has no printf; gcc is a compiler, ...
    (comp.lang.c)
  • Re: Purchase microcontroller dev. kit
    ... Some very smart and expensive compilers may be able to solve ... no one doing embedded development on a small microcontroller ... All of my projects use printf (which usually comes in several ... Having a command line interface is also ...
    (sci.electronics.design)