This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
g++ invokes cc1plus on *.c files
- From: Stephen Ma <stephenma at telus dot net>
- To: gcc at gcc dot gnu dot org
- Date: Wed, 7 Jan 2004 22:25:14 -0800
- Subject: g++ invokes cc1plus on *.c files
I'm not sure the following is even a bug, so I'm posting here and not
at Bugzilla. If it turns out to be a real bug, I will start a problem
report and work on a fix.
It seems that g++ invokes cc1plus on *.c files. Shouldn't cc1 be
invoked instead? Here's what g++ currently does:
$ g++ -v -c c-cast.c
Reading specs from /usr/lib/gcc-lib/i486-linux/3.3.2/specs
Configured with: ../src/configure -v --enable-languages=c,c++,java,f77,pascal,objc,ada,treelang --prefix=/usr --mandir=/usr/share/man --infodir=/usr/share/info --with-gxx-include-dir=/usr/include/c++/3.3 --enable-shared --with-system-zlib --enable-nls --without-included-gettext --enable-__cxa_atexit --enable-clocale=gnu --enable-debug --enable-java-gc=boehm --enable-java-awt=xlib --enable-objc-gc i486-linux
Thread model: posix
gcc version 3.3.2 (Debian)
/usr/lib/gcc-lib/i486-linux/3.3.2/cc1plus -quiet -v -D__GNUC__=3 -D__GNUC_MINOR__=3 -D__GNUC_PATCHLEVEL__=2 -D_GNU_SOURCE c-cast.c -D__GNUG__=3 -quiet -dumpbase c-cast.c -auxbase c-cast -version -o /tmp/ccaPTOfg.s
GNU C++ version 3.3.2 (Debian) (i486-linux)
compiled by GNU C version 3.3.2 (Debian).
GGC heuristics: --param ggc-min-expand=47 --param ggc-min-heapsize=32131
ignoring nonexistent directory "/usr/i486-linux/include"
#include "..." search starts here:
#include <...> search starts here:
/usr/include/c++/3.3
/usr/include/c++/3.3/i486-linux
/usr/include/c++/3.3/backward
/usr/local/include
/usr/lib/gcc-lib/i486-linux/3.3.2/include
/usr/include
End of search list.
as -V -Qy -o c-cast.o /tmp/ccaPTOfg.s
GNU assembler version 2.14.90.0.4 (i386-linux) using BFD version 2.14.90.0.4 20030523 Debian GNU/Linux
This behavior goes all the way back to at least 2.95.4 and continues
all the way up to snapshot gcc-3.4-20031231. If it's working as
designed (possible, since it's persisted for so long), I'm fine with
it.
But shouldn't g++ be able to compile any mixture of *.cpp *.c *.o *.a
files into an executable, with one command? Like this:
g++ alpha.cpp beta.c gamma.o
What do you think?