Subject: lib/6310: __RENAME() doesn't work with -traditional
To: None <gnats-bugs@gnats.netbsd.org>
From: ITOH Yasufumi <yasufu-i@is.aist-nara.ac.jp>
List: netbsd-bugs
Date: 10/16/1998 18:30:03
>Number:         6310
>Category:       lib
>Synopsis:       __RENAME() doesn't work with -traditional
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    lib-bug-people (Library Bug People)
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Fri Oct 16 02:35:00 1998
>Last-Modified:
>Originator:     ITOH Yasufumi
>Organization:
	Nara Institute of Science and Technology, Nara, Japan
>Release:        1.3H (Oct. 15, 1998)
>Environment:
System: NetBSD acha.my.domain 1.3H NetBSD 1.3H (UVM) #0: Fri Oct 16 15:21:37 JST 1998 itohy@myname.my.domain:/usr/src/sys/arch/x68k/compile/UVM x68k


>Description:
	C function renaming using __RENAME() macro won't work
	with gcc  -traditional  option.

>How-To-Repeat:

% ed foo.c
foo.c: No such file or directory
a
#include <unistd.h>
main()
{
	vfork();
	return 0;
}
.
w
52
q
% cc -traditional foo.c
/tmp/cc00260a.s: Assembler messages:
/tmp/cc00260a.s:11: Error: Ignoring junk after expression


% cc -traditional -E foo.c | grep __asm__
pid_t	 vfork ()			__asm__("_C_LABEL(__vfork14)");
						^^^ This is wrong

% cc -E foo.c | grep __asm__
pid_t	 vfork  (void)  			__asm__("___vfork14"  ) ;
							^^^ This is correct

>Fix:
	Change  __RENAME  macro definition like this???

	#ifdef __GNUC__
	#ifdef __STDC__
	#define	__RENAME(x)	__asm__(___STRING(_C_LABEL(x)))
	#else
	#define	__RENAME(x)	__asm__(_/**/x)
	#endif
	#endif

>Audit-Trail:
>Unformatted: