This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Answered Re: #pragma interface and #pragma implementation
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
On Thursday 03 June 2004 06:19, Steven T. Hatton wrote:
> The part that I don't understand is what does GCC think a source file is?
> That is, if there is a 1-1 correspondence between a source file and a
> translation unit, and anything that looks like C++ can be considered either
> source or header, there has to be some mechanism. I'm guessing "source
> file" means whatever follows the `g++ [options]' on the commandline.
I have my answer. I decided to grep the man pages and found this:
Compilation can involve up to four stages: preprocessing, compilation proper,
assembly and linking, always in that order. The
first three stages apply to an individual source file, and end by
producing an object file; linking combines all the object files
(those newly compiled, and those specified as input) into an executable
file.
For any given input file, the file name suffix determines what kind of
compilation is done:
file.c
C source code which must be preprocessed.
file.i
C source code which should not be preprocessed.
file.ii
C++ source code which should not be preprocessed.
file.m
Objective-C source code. Note that you must link with the library
libobjc.a to make an Objective-C program work.
file.mi
Objective-C source code which should not be preprocessed.
file.h
C header file (not to be compiled or linked).
file.cc
file.cp
file.cxx
file.cpp
file.c++
file.C
C++ source code which must be preprocessed. Note that in .cxx, the
last two letters must both be literally x. Likewise, .C
refers to a literal capital C.
- --
Regards,
Steven
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.2 (GNU/Linux)
iD8DBQFAvw6owX61+IL0QsMRAomIAKCbEncK2UXlWqEruUFfvaPhLZ4oqgCaAwfZ
9GbY7OofwrcBEYqBpDewRWc=
=HQ9v
-----END PGP SIGNATURE-----