www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/2001/09/11/04:05:21

Date: Tue, 11 Sep 2001 10:02:47 +0200 (IST)
From: Eli Zaretskii <eliz AT is DOT elta DOT co DOT il>
X-Sender: eliz AT is
To: Alex Vinokur <alexvn AT bigfoot DOT com>
cc: djgpp AT delorie DOT com
Subject: Re: gcc, gpp & option -v
In-Reply-To: <3B9DA231.4D584808@bigfoot.com>
Message-ID: <Pine.SUN.3.91.1010911100219.2127L-100000@is>
MIME-Version: 1.0
Reply-To: djgpp AT delorie DOT com
Errors-To: nobody AT delorie DOT com
X-Mailing-List: djgpp AT delorie DOT com
X-Unsubscribes-To: listserv AT delorie DOT com

On Tue, 11 Sep 2001, Alex Vinokur wrote:

> 1. Why do _both 'gcc -v' and 'gpp -v'_ produce the same output?

No, they don't.  "gcc -v" says:

  d:/sys/djgpp/lib/gcc-lib/djgpp/2.953/cpp0.exe -lang-c -v -D__GNUC__=2

while "gpp -v" says:

  d:/sys/djgpp/lib/gcc-lib/djgpp/2.953/cpp0.exe -lang-c++ -v -D__GNUC__=2

See that "-lang-c++" in gpp's output?  That's the difference.

In other words, gpp by default assumes it is a compiling a C++
program, while gcc assumes it's a C program.

> 2. What is GNU CPP version ... ? (C compiler?)

It's the preprocessor.

> 3. 'gpp -v a.c' produces _C++ compiler_ version as well.
>    Why doesn't 'gpp -v' do the same thing?

The line

  GNU C++ version 2.95.3 20010315/djgpp (release) (djgpp) compiled by GNU
  C version 2.95.3 20010315/djgpp (release).

comes from the program cc1plus.exe invoked by gpp (that's one of the
lines you snipped).  cc1plus is the C++ compiler.  When you type just
"gpp -v", the compiler is not invoked at all, since there's nothing to
compile.  So cc1plus doesn't run and doesn't print anything.

> 4. Is there any option that produces _C++ compiler_ version ? :
>    %gpp <?-option>
>    GNU C++ version 2.95.3 20010315/djgpp (release) (djgpp) compiled by
> GNU C version 2.95.3 20010315/djgpp (release).

Try this:

  d:\sys\djgpp\lib\gcc-lib\djgpp\2.953\cc1plus -version < nul > nul

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019