gcc 4.8 vs x86 kernels w/o genfb

2014-03-12 Thread John D. Baker

amd64/i386 kernels that omit "genfb" (NGENFB == 0) fail to build:

[...]
--- consinit.o ---
/x/current/src/sys/arch/x86/x86/consinit.c: In function 'consinit':
/x/current/src/sys/arch/x86/x86/consinit.c:150:35: error: variable 'fbinfo' set 
but not used [-Werror=unused-but-set-variable]
  const struct btinfo_framebuffer *fbinfo;
   ^
cc1: all warnings being treated as errors
*** [consinit.o] Error code 1

nbmake: stopped in /d0/build/current/obj/amd64/sys/arch/amd64/compile/SCRAPPY
1 error

Some use-case reorganization gives:

+Index: sys/arch/x86/x86/consinit.c
+===
+RCS file: /cvsroot/src/sys/arch/x86/x86/consinit.c,v
+retrieving revision 1.26
+diff -u -b -r1.26 consinit.c
+--- sys/arch/x86/x86/consinit.c26 Jan 2014 15:49:25 -  1.26
 sys/arch/x86/x86/consinit.c12 Mar 2014 11:17:07 -
+@@ -147,7 +147,6 @@
+ consinit(void)
+ {
+   const struct btinfo_console *consinfo;
+-  const struct btinfo_framebuffer *fbinfo;
+   static int initted;
+ #if (NCOM > 0)
+   int rv;
+@@ -163,11 +162,12 @@
+ #endif
+   consinfo = &default_consinfo;
+ 
+-	fbinfo = lookup_bootinfo(BTINFO_FRAMEBUFFER);

+-
+   if (!strcmp(consinfo->devname, "pc")) {
+   int error;
+ #if (NGENFB > 0)
++  const struct btinfo_framebuffer *fbinfo;
++
++  fbinfo = lookup_bootinfo(BTINFO_FRAMEBUFFER);
+   if (fbinfo && fbinfo->physaddr > 0) {
+   if (x86_genfb_cnattach() == -1) {
+   initted = 0;/* defer */

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



Re: gcc 4.8 vs x86 kernels w/o genfb

2014-03-12 Thread Martin Husemann
On Wed, Mar 12, 2014 at 07:21:36AM -0500, John D. Baker wrote:
> amd64/i386 kernels that omit "genfb" (NGENFB == 0) fail to build:

Fixe, thanks!

Martin