Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > C Programming > Which files are necessary to be compiled?

Reply
Thread Tools

Which files are necessary to be compiled?

 
 
Sortie
Guest
Posts: n/a
 
      09-11-2009
Suppose a project that has several files and assume the
preprocessor directives are not involved in the following.

Is it always enough to compile just the .c files that have
changed since the last full compile?

In which cases this is not enough?
 
Reply With Quote
 
 
 
 
jameskuyper
Guest
Posts: n/a
 
      09-11-2009
Richard Heathfield wrote:
> In <Xns9C83E0E68A5D1pinkisntwellgmailcom@147.102.222. 230>, Sortie
> wrote:
>
> > Suppose a project that has several files and assume the
> > preprocessor directives are not involved in the following.
> >
> > Is it always enough to compile just the .c files that have
> > changed since the last full compile?

>
> Assuming that your project consists of nothing but .c files, yes,
> that's sufficient. But that isn't always the case.
>
> > In which cases this is not enough?

>
> One obvious example - you have written a .h file, and /that's/
> changed. Then, any dependencies of that .h file need to be
> recompiled.


Sortie said "assume the preprocessor directives are not involved in
the following". The wording and intent of that phrase is less than
perfectly clear, but it might be taken as implying, among other
things, that any #include preprocessor directives that might be
present should be assumed to refer to files (or standard headers)
which have not changed.
 
Reply With Quote
 
 
 
 
Richard Bos
Guest
Posts: n/a
 
      09-12-2009
Eric Sosman <(E-Mail Removed)> wrote:

> Sortie wrote:
> > Suppose a project that has several files and assume the
> > preprocessor directives are not involved in the following.

>
> There's something wrong with a project that has "several" files
> and does not at the very least use #include to compile some of those
> files as parts of others. But letting that pass for now ...
>
> > Is it always enough to compile just the .c files that have
> > changed since the last full compile?

>
> Yes, assuming you've used the same compiler and the same compile-
> time option flags (or equivalent) throughout.


No, since if we're doing stupid things like assuming that "the
preprocessor directives are not involved", there is nothing to stop us
from calling our source files "something.cee" instead of "something.c".

Never underestimate the perversity of the undergrad lecturer asking
imbecilic questions.

Richard
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
operator == - necessary for which STL algorithms? Stephen Howe C++ 1 11-15-2010 07:40 PM
Which *.jar files are minimal necessary to compile JAX-WS web service + client? Catherina Svensson Java 0 05-19-2008 05:47 AM
Creating necessary configuration files on package installation David G. Hong Perl Misc 2 04-21-2008 01:12 AM
Which external modules are necessary for Ruby (1.9)? Wolfgang NĂ¡dasi-Donner Ruby 3 12-26-2007 02:36 PM
ASP.NET Files necessary on production system Steffen Loringer ASP .Net 4 01-15-2004 03:04 PM



Advertisments