Need help with C bug.

Bryan Cardoza bryan at iconsys.UUCP
Wed Mar 22 09:27:10 AEST 1989


Has anyone isolated the following pcc2 bug?  (I assume it is a bug.)
We have a Mot SVR2 based compiler.

	char	p[50];

	main()
	{
		printf("p = 0x%08X\n", p);
		if (p)
			printf("ok\n");
		else
			printf("bad berries\n");
	}

When run, this it says:

	p = 0x00002F84
	bad berries

The relevant m68k assembly code is:

	mov.l	&_p,(%sp)		# This is correct
	mov.l	&L%15,-(%sp)
	jsr	_printf
	add.l	&4,%sp
	tst.l	_p			# OOPS!  This should be "&_p".

Any pointers?
-- 
Bryan Cardoza			uunet!iconsys!bryan
Software Engineer
SANYO/ICON			Telephone: (801) 225-6888
Orem, Utah			FAX: (801) 226-0651



More information about the Comp.unix.wizards mailing list