By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
432,537 Members | 1,750 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 432,537 IT Pros & Developers. It's quick & easy.

Is there a difference between a "module" and a "compilation unit" ?

P: n/a
Bob

Are they different names for the same concept ?

Nov 14 '05 #1
Share this Question
Share on Google+
5 Replies


P: n/a
In article <cn********************************@4ax.com>
Bob <bo*@bob.bob> wrote:
Are they different names for the same concept ?
[For clarity about the pronoun "they", I will repeat the subject
line for those whose news-delivery systems mangle it:]
Is there a difference between a "module" and a "compilation unit" ?


That depends on who does the defining, no? :-)

The C standards define the term "translation unit". They do not
define either "compilation unit" or "module". Thus, this newsgroup
(comp.lang.c) cannot give you a definitive answer to the question.

In languages that actually have modules (such as Modula-2 and
Modula-3), I might claim there is a subtle difference, in that
a module may require more than one compilation step and each
such step could be termed a "unit". But you would have to define
these terms with respect to C before you could get an answer.
--
In-Real-Life: Chris Torek, Wind River Systems
Salt Lake City, UT, USA (4039.22'N, 11150.29'W) +1 801 277 2603
email: forget about it http://web.torek.net/torek/index.html
Reading email is like searching for food in the garbage, thanks to spammers.
Nov 14 '05 #2

P: n/a
Bob
On 20 Mar 2005 20:25:44 GMT, Chris Torek <no****@torek.net> wrote:
Is there a difference between a "module" and a "compilation unit" ?
That depends on who does the defining, no? :-)


Yes.
The C standards define the term "translation unit". They do not
define either "compilation unit" or "module". Thus, this newsgroup
(comp.lang.c) cannot give you a definitive answer to the question.


So be it: "translation unit" will be used (by me) from now on. :-)

Thanks.

Nov 14 '05 #3

P: n/a
Bob wrote:

On 20 Mar 2005 20:25:44 GMT, Chris Torek <no****@torek.net> wrote:
Is there a difference between a "module" and a "compilation unit" ?


That depends on who does the defining, no? :-)


Yes.
The C standards define the term "translation unit". They do not
define either "compilation unit" or "module". Thus, this newsgroup
(comp.lang.c) cannot give you a definitive answer to the question.


So be it: "translation unit" will be used (by me) from now on. :-)


A translation unit is the output of the preprocessor.
A translation unit consists of a sequence of external declarations.

--
pete
Nov 14 '05 #4

P: n/a
pete wrote:
-> Bob wrote:
-> > Chris Torek <no****@torek.net> wrote:
-> > > > Is there a difference between a "module" and a
-> > > > "compilation unit" ?
-> > >
-> > > That depends on who does the defining, no? :-)
-> >
-> > Yes.
-> >
-> > > The C standards define the term "translation unit". They do
-> > > not define either "compilation unit" or "module". Thus, this
-> > > newsgroup (comp.lang.c) cannot give you a definitive answer
-> > > to the question.
-> >
-> > So be it: "translation unit" will be used (by me) from now on. :-)
->
-> A translation unit is the output of the preprocessor.
-> A translation unit consists of a sequence of external declarations.

Section 5 says... "An implementation translates C source files..."

"Source file" probably makes more sense than translation unit, or
preprocessing translation unit (which by definition may consist of
more than one file.)

Although programming has the concept of modules, C generally doesn't.
There is no immediate way to share objects with external linkage
exclusively within a select group of source files.

--
Peter

Nov 14 '05 #5

P: n/a
Bob
On 21 Mar 2005 03:19:54 -0800, "Peter Nilsson" <ai***@acay.com.au>
wrote:
Although programming has the concept of modules, C generally doesn't.
There is no immediate way to share objects with external linkage
exclusively within a select group of source files.


Exactly. Something like what Delphi does for example, if I'm not
mistaken.
Nov 14 '05 #6

This discussion thread is closed

Replies have been disabled for this discussion.