Subject: bin/1943: /usr/bin/c++ should invokes /usr/bin/cc
To: None <gnats-bugs@gnats.netbsd.org>
From: None <bouyer@ensta.fr>
List: netbsd-bugs
Date: 01/14/1996 20:46:07
>Number:         1943
>Category:       bin
>Synopsis:       /usr/bin/c++ gives me g++ 2.6.3
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    bin-bug-people (Utility Bug People)
>State:          open
>Class:          change-request
>Submitter-Id:   net
>Arrival-Date:   Sun Jan 14 15:05:01 1996
>Last-Modified:
>Originator:     Manuel Bouyer
>Organization:

Ecole Nationale Superieure de Techniques Avancees, Paris

>Release:        -current 95 01 13
>Environment:
	
System: NetBSD chassiron.ensta.fr 1.1A NetBSD 1.1A (CHASSIRON) #1: Sun Jan 14 19:08:53 MET 1996 bouyer@chassiron.ensta.fr:/usr/src/src_current/sys/arch/i386/compile/CHASSIRON i386


>Description:
	I have gcc 2.6.3 installed in /usr/local/bin. I have /usr/bin after
	/usr/local/bin in $path, so invoking gcc gives me gcc 2.6.3 and
	cc gives me NetBSD's native compiller (currently gcc 2.7.2).
	As /usr/bin/c++ invokes gcc, i get the "site" c++ compiller instead of
	NetBSD's native c++ compiller. So i think c++ should invokes at
	least cc instead of gcc, or better /usr/bin/cc (hardcoded).
>How-To-Repeat:
	Install a different gcc in /usr/local/bin, set up your path to
	have /usr/local/bin before /usr/bin. Type "/usr/bin/c++ -v".
	You should get something likes:
	chassiron:/usr/src/src_current/gnu>/usr/bin/c++ -v
	 gcc -v
	 Reading specs from /usr/local/lib/gcc-lib/i386-unknown-netbsd1.0A/i2.6.3/specs
	 gcc version i2.6.3

>Fix:
	Apply the patch below. It makes c++ invokes /usr/bin/cc.
	The manpage should perhaps be corrected to rename "gcc" in "cc" too.

Index: gnu/usr.bin/gcc/g++/g++.c
===================================================================
RCS file: /usr/cvs/cvsroot/sources/src_current/gnu/usr.bin/gcc/g++/g++.c,v
retrieving revision 1.1.1.1
diff -c -r1.1.1.1 g++.c
*** g++.c	1996/01/13 18:31:21	1.1.1.1
--- g++.c	1996/01/14 19:11:32
***************
*** 51,57 ****
     Makefile should compile this file with the proper name
     (e.g., "i386-aout-gcc").  */
  #ifndef GCC_NAME
! #define GCC_NAME "gcc"
  #endif
  
  /* This bit is set if we saw a `-xfoo' language specification.  */
--- 51,57 ----
     Makefile should compile this file with the proper name
     (e.g., "i386-aout-gcc").  */
  #ifndef GCC_NAME
! #define GCC_NAME "/usr/bin/cc"
  #endif
  
  /* This bit is set if we saw a `-xfoo' language specification.  */
>Audit-Trail:
>Unformatted: