first C source file to be compiled

M

Marc Jeambrun

Hello,

I have a simple question I would like to ask to you guys... It boils
down to a simple observation about all the C libraries existing out
there: there must be a C source file that must be compiled first, I mean
before all the others.

That's why I poke my nose in a C library (GNU glibc for instance) to
find out this mysterious file... This is indeed the library programmers
(including me) often refer to.

But I'm not good enough to extract from autotools-related files (in the
glibc tarball) which C file is compiled first. Or perhaps I made a
mistake in my way of thinking and this file is actually located elsewhere...

Can you help me in this tremendous quest for truth finding this C source
file ?

Thanks in advance for your help.

Marc Jeambrun
 
S

santosh

Marc said:
Hello,

I have a simple question I would like to ask to you guys... It boils
down to a simple observation about all the C libraries existing out
there: there must be a C source file that must be compiled first, I mean
before all the others.

That's why I poke my nose in a C library (GNU glibc for instance) to
find out this mysterious file... This is indeed the library programmers
(including me) often refer to.

But I'm not good enough to extract from autotools-related files (in the
glibc tarball) which C file is compiled first. Or perhaps I made a
mistake in my way of thinking and this file is actually located elsewhere...

Can you help me in this tremendous quest for truth finding this C source
file ?

There need be nothing special about the module to be compiled first. It
depends on the command lines generated by makefiles and for projects
like glibc(), can be quite involved, and may vary from machine to
machine, OS to OS, compiler to compiler.

It's also a detail of implementation and instance and hence off-topic
here.
 
C

Chris Dollin

Marc said:
I have a simple question I would like to ask to you guys... It boils
down to a simple observation about all the C libraries existing out
there: there must be a C source file that must be compiled first, I mean
before all the others.

Even assuming that there must be a compiled-first file, what are you
thinking of doing with it when you've got it?

[It would, I think, be more than 30 years old ... if it exists at all.]
 
R

Richard Heathfield

Marc Jeambrun said:
Hello,

I have a simple question I would like to ask to you guys... It boils
down to a simple observation about all the C libraries existing out
there: there must be a C source file that must be compiled first, I mean
before all the others.

Ponder no more!

You are right - there *is* such a file. But there's no mystery about it. It
is often published in books on the C language. For example, you can find it
on page 1000 of K&R2, a trivial variant on page 100001 of "C: How to
Program", 5th edition, by Deitel and Deitel, and 1001 of "C: A Reference
Manual", 4th edition, by Harbison and Steele. I've written the page numbers
given in binary because I know how much students like to feel involved in
the learning process.
 
J

jacob navia

Marc said:
Hello,

I have a simple question I would like to ask to you guys... It boils
down to a simple observation about all the C libraries existing out
there: there must be a C source file that must be compiled first, I mean
before all the others.

That's why I poke my nose in a C library (GNU glibc for instance) to
find out this mysterious file... This is indeed the library programmers
(including me) often refer to.

But I'm not good enough to extract from autotools-related files (in the
glibc tarball) which C file is compiled first. Or perhaps I made a
mistake in my way of thinking and this file is actually located
elsewhere...

Can you help me in this tremendous quest for truth finding this C source
file ?

Thanks in advance for your help.

Marc Jeambrun

There is a file that in many systems must be linked first.
You are confusing (maybe) compiling and linking...

That file is called "the startup file" or simply
the stratup. It is normally written in assembler but it can
be written in C too.

Is this the file you are referring to?
 
N

Norbert Kolvenbach

Richard said:
Marc Jeambrun said:


Ponder no more!

You are right - there *is* such a file. But there's no mystery about it.
It is often published in books on the C language. For example, you can
find it on page 1000 of K&R2, a trivial variant on page 100001 of "C: How
to Program", 5th edition, by Deitel and Deitel, and 1001 of "C: A
Reference Manual", 4th edition, by Harbison and Steele. I've written the

Richard, this is a serious error, it was
the 7th edition of Harsteel and Humbug from 1977.
 
S

Stephen Sprunk

Marc Jeambrun said:
I have a simple question I would like to ask to you guys... It boils
down to a simple observation about all the C libraries existing out
there: there must be a C source file that must be compiled first, I
mean before all the others.

There is no requirement that any particular file must be compiled first.
In every large project I've seen, the source files are compiled in
seemingly-random order.

Linking, which is OT here, may require that some files be linked before
others, but that typically happens after _all_ the files are compiled,
so compilation order is again irrelevant.

S
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,054
Latest member
TrimKetoBoost

Latest Threads

Top