C and C++ compile speed

This is a discussion on C and C++ compile speed within the A Brief History of Cprogramming.com forums, part of the Community Boards category; Strange one, but when I use DevC++ on the rare ocassion, I have discovered somthing interesting about the compiler. If ...

  1. #1
    Its hard... But im here swgh's Avatar
    Join Date
    Apr 2005
    Location
    England
    Posts
    1,479

    C and C++ compile speed

    Strange one, but when I use DevC++ on the rare ocassion, I have discovered somthing interesting about the compiler.

    If I write and compile a C++ program it compiles in the standard compile time.
    If I write a C program and ensure it compiles with a .c extension, the compiler
    compiles the C code in lightning quick speed, even faster than if was compiling
    C++ code with the .cpp extension.

    Did the creators of the MINGW compiler intend C programmers to use it in favor of C++? Why does it compile C code faster than C++ code?
    I'm just trying to be a better person - My Name Is Earl

  2. #2
    and the hat of wrongness Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    32,659
    Because C is easier to compile than C++ perhaps?
    If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
    If at first you don't succeed, try writing your phone number on the exam paper.
    I support http://www.ukip.org/ as the first necessary step to a free Europe.

  3. #3
    l'Anziano DavidP's Avatar
    Join Date
    Aug 2001
    Location
    Plano, Texas, United States
    Posts
    2,738
    Like Salem said, C is easier to compile. C is a much simpler language that doesnt have to worry about classes, inheritance, templates, etc.
    My Website

    "Circular logic is good because it is."

  4. #4
    Its hard... But im here swgh's Avatar
    Join Date
    Apr 2005
    Location
    England
    Posts
    1,479
    Ok thanks guys. I didnt think the answer was that simple.
    I'm just trying to be a better person - My Name Is Earl

Popular pages Recent additions subscribe to a feed

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21