469,957 Members | 2,716 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,957 developers. It's quick & easy.

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

Bob

Are they different names for the same concept ?

Nov 14 '05 #1
5 3259
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
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
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
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
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.

Similar topics

3 posts views Thread by Mark Harrison | last post: by
36 posts views Thread by Andrea Griffini | last post: by
51 posts views Thread by Noam Raphael | last post: by
1 post views Thread by Darran Edmundson | last post: by
5 posts views Thread by Steven T. Hatton | last post: by
205 posts views Thread by Jeremy Siek | last post: by
5 posts views Thread by Verde | last post: by
reply views Thread by rainxy | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.