Appeasing gcc48 for mvme68k

"John D. Baker" <[email protected]> Wed, 26 Mar 2014 12:18:36 -0500 (CDT)
Newsgroups gmane.os.netbsd.ports.mvme68k,gmane.os.netbsd.current
Message-ID <[email protected]>
A couple of unused variable fixes relevant to mvmeXXX(X) were committed
recently.  A couple more are needed for mvme68k:


+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	13 Mar 2014 23:16:37 -0000
+@@ -114,7 +114,7 @@
+ int
+ tape_close(struct open_file *f)
+ {
+-	struct mvmeprom_dskio *ti;
++	struct mvmeprom_dskio *ti __unused;
+ 
+ 	ti = f->f_devdata;
+ 	f->f_devdata = NULL;

I didn't analyse it further, but unless the assignment above is a
register access, "ti" could be eliminated entirely.


+Index: sys/lib/libsa/loadfile_elf32.c
+===================================================================
+RCS file: /cvsroot/src/sys/lib/libsa/loadfile_elf32.c,v
+retrieving revision 1.30
+diff -u -b -r1.30 loadfile_elf32.c
+--- sys/lib/libsa/loadfile_elf32.c	27 Nov 2013 17:33:03 -0000	1.30
++++ sys/lib/libsa/loadfile_elf32.c	26 Mar 2014 14:16:27 -0000
+@@ -273,7 +273,7 @@
+ 		uint8_t		desc[ELF_NOTE_NETBSD_DESCSZ];
+ 	} note;
+ 	char *shstr = NULL;
+-	size_t shstrsz = 0;
++	size_t shstrsz __unused = 0;
+ 	int boot_load_ctf = 1;
+ 
+ 	/* some ports dont use the offset */

The variable "shstrsz" appears in a DEALLOC() macro later in the function
so I don't know why gcc48 complains--unless the macro collapses the
corresponding parameter (or entirely) for certain architectures or
applications.


There is a bit more to figure out.  Building VME172 kernel fails with:

[...]
--- kern-VME172 ---
/var/tmp//ccXkxWRo.s: Assembler messages:
/var/tmp//ccXkxWRo.s:12: Error: selected processor does not have all features of selected architecture
*** [compat_exec.o] Error code 1
nbmake[3]: stopped in /d0/build/current/obj/mvme68k/sys/arch/mvme68k/compile/VME172/lib/compat
1 error
nbmake[3]: stopped in /d0/build/current/obj/mvme68k/sys/arch/mvme68k/compile/VME172/lib/compat
*** [/d0/build/current/obj/mvme68k/sys/arch/mvme68k/compile/VME172/lib/compat/libcompat.a] Error code 2
nbmake[2]: stopped in /d0/build/current/obj/mvme68k/sys/arch/mvme68k/compile/VME172
1 error
nbmake[2]: stopped in /d0/build/current/obj/mvme68k/sys/arch/mvme68k/compile/VME172
*** [kern-VME172] Error code 2
[...]

I'll see about rebuilding with "-save-temps" to see what it's complaining
about.

-- 
|/"\ 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