Talk About Network

Google


Register and Login
Nick
Password
Register create new account Sign up is FREE and you can post replies, new topics, bookmark posts and more!
Recover lost password


Programming > C++ Moderated > Re: Compilation...
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 2 of 16 Topic 9546 of 9775
Post > Topic >>

Re: Compilation speedup trick: any side-effects?

by rado <rgetov@[EMAIL PROTECTED] > Apr 25, 2008 at 03:49 PM

On Apr 25, 10:13 am, bor...@[EMAIL PROTECTED]
 wrote:
> Hi all,
>
> to reduce the build-time of our project we use following trick:
>
> Instead of compiling each CPP and linking together, we auto-generate a
> CPP which includes all CPP of the project and compile only this one.
> The effect is that the compiler has to compile each involved header
> only once opposed to a per-cpp-file basis.
>
> The question is: once it compiled successfully (no duplicate
> definitions etc), is there any side-effect possible? Is the linked
> library/executable any different than the one produced the 'normal'
> way?
>
> There is one issue I already can think of: the order of the execution
> of constructors of static objects (like global variables). Any more?

{ edits: quoted signature & clc++m banner removed. please don't quote
extraneous 
material. tia., -mod }

Hi,

File-scope entities, anonymous namespace contents, and preprocessor
#defines will merge.
These collisions will (in most cases) break the compilation. So, if
you don't see any
build problems you *might* be OK.

You could of course get silent program behaviour changes. Different
#defines and
overloads'/template specialization visibility are two things I can
think of.

BTW the initialization order of globals is not defined across
compilation units.
Your approach will actually defines it, as long as you don't shuffle
the files.

Radoslav Getov



-- 
      [ See http://www.gotw.ca/resources/clcm.htm
for info about ]
      [ comp.lang.c++.moderated.    First time posters: Do this! ]
 




 16 Posts in Topic:
Compilation speedup trick: any side-effects?
borphi@[EMAIL PROTECTED]   2008-04-25 11:13:19 
Re: Compilation speedup trick: any side-effects?
rado <rgetov@[EMAIL PR  2008-04-25 15:49:57 
Re: Compilation speedup trick: any side-effects?
Francis Glassborow <fr  2008-04-25 16:13:19 
Re: Compilation speedup trick: any side-effects?
Davis King <davis685@[  2008-04-25 16:17:05 
Re: Compilation speedup trick: any side-effects?
Brendan <catphive@[EMA  2008-04-25 16:13:20 
Re: Compilation speedup trick: any side-effects?
Maciej Sobczak <see.my  2008-04-25 17:13:19 
Re: Compilation speedup trick: any side-effects?
Mathias Gaunard <loufo  2008-04-26 03:33:38 
Re: Compilation speedup trick: any side-effects?
Carl Barron <cbarron41  2008-04-26 03:34:04 
Re: Compilation speedup trick: any side-effects?
"borphi@[EMAIL PROTE  2008-04-26 09:43:22 
Re: Compilation speedup trick: any side-effects?
Francis Glassborow <fr  2008-04-26 16:28:03 
Re: Compilation speedup trick: any side-effects?
Francis Glassborow <fr  2008-04-26 16:27:40 
Re: Compilation speedup trick: any side-effects?
mlag.ng@[EMAIL PROTECTED]  2008-04-27 07:12:05 
Re: Compilation speedup trick: any side-effects?
Mathias Gaunard <loufo  2008-04-27 07:29:16 
Re: Compilation speedup trick: any side-effects?
Andre Poenitz <poenitz  2008-04-27 15:45:41 
Re: Compilation speedup trick: any side-effects?
Francis Glassborow <fr  2008-04-28 16:03:16 
Re: Compilation speedup trick: any side-effects?
Peter Holtwick <borphi  2008-04-29 10:43:23 

Post A Reply:
  Go here to Signup

AddThis Feed Button


About - Advertising - Contact - Frequently Asked Questions - Privacy Policy - Terms of Use - Signup

Contact
tan12V112 Tue Jul 8 23:17:50 CDT 2008.