Ananth A wrote:

>On 4/7/06, Jayasimha Ananth <jayasimha.a at gmail.com> wrote:
>  
>
>>What is a conditional compiler?
>>    
>>
>
>TurboC and MSVC++ uses this feature of compiling only the changed part
>instead of recompiling/linking the whole source code. Gcc/G++ on the
>other hand doesnt keep track of the changes and ends up compiling
>everything again.  this is good for batch compilation but not so good
>for frequent compilations. you can test by making just 2-3 line
>changes in your code and recompiling it.  tc/msvc would finish
>compiling almost instantly than gcc/g++ would.
>  
>
   There are three things that you seem to imply here: 1) Compiling just the
   changed files as opposed to compiling all the source files; 2) Compiling
   parts of changed files as opposed to compiling all the files; 3) Pre-
   compiled headers.

   As for #1, it is the normal behavior even on *NIX systems if you have the
   Makefiles set up properly. Make takes care of tracking file modifications
   and invokes gcc for only the changed files.

    As for #2, I am not sure whether Tc or MVC does this, but maybe this is
    done at the function level.

    #3 is supported by gcc with the appropriate options.

    Technically the term conditional compilation  applies to preprocessor
    directives that control which source lines are processed by the 
compiler.

>btw, on a slightly off topic, g++ compiles much slower than gcc. at
>least 2-3x slower.... you can test it even with a simple program of
>printf("hello world") ... im using the 4.0.1 version and the same c
>code with both gcc and g++ for testing.  has anybody else noticed the
>same ??
>  
>
   Yeah C++ compilation is always slower due to overheads. Have you tried
   adding   extern "C"  for you hello world program to force C linkage and
   disable the C++ poly-mangled-virtual-inherited-temporarily-constructed-
   referential overheads ?   I dunno whether this will help though. :-P

Regards,
Moinak.

>just noticed on the sun studio website that there is a version
>released for linux also... has anyone tried it ?? any comments ??
>
>Ananth
>_______________________________________________
>ug-bosug mailing list
>List-Unsubscribe: mailto:ug-bosug-unsubscribe at opensolaris.org
>List-Owner: mailto:ug-bosug-owner at opensolaris.org
>List-Archives: http://www.opensolaris.org/jive/forum.jspa?forumIDT
>  
>


Reply via email to