Re: Appeasing gcc48 for mvme68k

"John D. Baker" <[email protected]> Thu, 27 Mar 2014 12:52:06 -0500 (CDT)
Newsgroups gmane.os.netbsd.ports.mvme68k
Message-ID <[email protected]>
After some poking around, I'm convinced that "ti" and its assignment
are superfluous and can be removed.

+Index: sys/arch/mvme68k/stand/bootst/dev_tape.c
+===================================================================
+RCS file: /cvsroot/src/sys/arch/mvme68k/stand/bootst/dev_tape.c,v
+retrieving revision 1.12
+diff -u -b -r1.12 dev_tape.c
+--- sys/arch/mvme68k/stand/bootst/dev_tape.c	17 Jul 2011 20:54:44 -0000	1.12
++++ sys/arch/mvme68k/stand/bootst/dev_tape.c	27 Mar 2014 17:20:53 -0000
+@@ -114,9 +114,6 @@
+ int
+ tape_close(struct open_file *f)
+ {
+-	struct mvmeprom_dskio *ti;
+-
+-	ti = f->f_devdata;
+ 	f->f_devdata = NULL;
+ 	return 0;
+ }

The libsa/loadfile_elf32.c issue with DEALLOC(a, b) stems from variant
definitions depending on whether _STANDALONE is defined.  The relevant
definitions are in "sys/arch/mvme68k/include/loadfile_machdep.h".  In
short:

#ifdef _STANDALONE
#define DEALLOC(a, b)	dealloc(a, b)
#else
#define DEALLOC(a, b)	free(a)
#endif

I propose the following patch:

+Index: sys/arch/mvme68k/include/loadfile_machdep.h
+===================================================================
+RCS file: /cvsroot/src/sys/arch/mvme68k/include/loadfile_machdep.h,v
+retrieving revision 1.5
+diff -u -b -r1.5 loadfile_machdep.h
+--- sys/arch/mvme68k/include/loadfile_machdep.h	28 Apr 2008 20:23:29 -0000	1.5
++++ sys/arch/mvme68k/include/loadfile_machdep.h	27 Mar 2014 17:22:47 -0000
+@@ -59,7 +59,7 @@
+ #define WARN(a)			warn a
+ #define PROGRESS(a)		/* nothing */
+ #define ALLOC(a)		malloc(a)
+-#define DEALLOC(a, b)		free(a)
++#define DEALLOC(a, b)		free(a); __USE(b)
+ #define OKMAGIC(a)		((a) == OMAGIC)
+ 
+ #endif

While tracking this down, I noticed several other architectures
with the same variant definition of DEALLOC(a,b)--most of the other
m68k architectures and a couple of others.  They may require similar
treatment.

-- 
|/"\ John D. Baker, KN5UKS               NetBSD     Darwin/MacOS X
|\ / jdbaker[snail]mylinuxisp[flyspeck]com    OpenBSD            FreeBSD
| X  No HTML/proprietary data in email.   BSD just sits there and works!
|/ \ GPGkeyID:  D703 4A7E 479F 63F8 D3F4  BD99 9572 8F23 E4AD 1645