A
Arne Vajhøj
I did not want a C compiler. I simply wanted a preprocessor.
If the C compilers preprocessor can be invoked separately, then
why not use it.
Arne
I did not want a C compiler. I simply wanted a preprocessor.
The last C compilers I remember that had separate preprocessors were K&R,I did not want a C compiler. I simply wanted a preprocessor.
The last C compilers I remember that had separate preprocessors were K&R,
so were very old. In these, cc was effectively a shell that invoked the
preprocessor, the C --> assembler translator, the assembler and the
linker in turn. Actually, I'm still using one - the standard OS/9 v2.4 C
compiler, which dates from 1992 and runs on 68xxx hardware.
I don't remember any ANSI C compilers I've used being structured this
way: certainly I've not seen any version of the GNU compiler or its
derivatives that aren't a monolithic chunk that includes all compilation
stages except the linker. AFAICR this also applied to the Borland
compilers.
So, if that's really what you want, go and find a old K&R compiler or its
source.
GCC still has a separate executable for preprocessing!
The driver gcc or g++ calls cpp, cc1 or cc1plus, as and ld.
Fair cop, guv.On 7/23/2011 9:19 AM, Martin Gregorie wrote:
GCC still has a separate executable for preprocessing!
The driver gcc or g++ calls cpp, cc1 or cc1plus, as and ld.
<http://gcc.gnu.org/onlinedocs/gcc-4.6.1/gcc/Preprocessor-
Options.html#Preprocessor-Options>
"If you use the -E option, nothing is done except preprocessing. Some
of these options make sense only together with -E because they cause
the preprocessor output to be unsuitable for actual compilation."
Ain't the FM (of "RTFM") a marvel? Amazing what one can learn by
reading the documentation!
Is is great reading the FM.
In this case the FM (at least not in what you quote) does not cover
the topic of discussion - whether it is a monolithic executable
or a series of executables.
lewbloch said:A difference that makes no difference is no difference.
A difference that makes no difference is no difference.
But for completeness:
This can be learned from reading the frakkin' manual as suggested!
Does everyone have to be spoonfed everything?
The idea here is to follow the general principle, e.g., RTFM!, so that
one can be independently brilliant. Just because I only led you to
the door and didn't open it and spread roses in your path doesn't make
my advice bad. I anticipate that any real programmer will take the
hint and do their own homework, once shown where they can look.
For example, the poster who whined about wanting a standalone
preprocessor could have easily looked up those links posted here,
given the hint that it was at least possible that the indicated
documentation would yield that data. For that matter, so could you
have. It would have been far more helpful for you to post the
additional data to help that whiner than to speciously complain that I
didn't. Don't you want to be helpful?
But in the end, monolithic or separate, they get the ability to run
the preprocessor on its own EVEN WERE IT PART OF A MONOLITHIC
PROGRAM! Why wouldn't that suit, hm?
Fair cop, guv.
I looked at /usr/bin, thought the preprocessor was called cpre so didn't
find it and glanced through 'man gcc' but didn't find anything describing
the compiler structure. The fact that the options are subdivided onto
compilation stages doesn't necessarily say anything about the compiler
physical structure, and as gcc is fairly big, I assumed....
I looked for cpre since I thought that was what the preprocessor wasIt is cpp (or gcc-cpp).
Not a very good name - most would assume that cpp=c plus plus.
But then most people would call it via the general compiler driver, so
it does not matter much.
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.