NetBSD-Bugs archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

kern/41451: GENERIC_TINY build breaks due to warnings being treated as errors



>Number:         41451
>Category:       kern
>Synopsis:       GENERIC_TINY build breaks due to warnings being treated as 
>errors
>Confidential:   no
>Severity:       non-critical
>Priority:       high
>Responsible:    kern-bug-people
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Sun May 17 17:15:01 +0000 2009
>Originator:     Stathis Kamperis
>Release:        Host is NetBSD 5.0. Failure refers to -current.
>Organization:
Aristotle University of Thessaloniki
>Environment:
NetBSD voyager 5.0 NetBSD 5.0 (GENERIC) #0: Sun Apr 26 18:50:08 UTC 2009  
builds%b6.netbsd.org@localhost:/home/builds/ab/netbsd-5-0-RELEASE/i386/200904260229Z-obj/home/builds/ab/netbsd-5-0-RELEASE/src/sys/arch/i386/compile/GENERIC
 i386

>Description:
During the build process of GENERIC_TINY it fails with:

cc1: warnings being treated as errors
/usr/src/sys/arch/x86/x86/x86_autoconf.c: In function 'device_register':
/usr/src/sys/arch/x86/x86/x86_autoconf.c:505: warning: unused variable 
'found_console'

The problem is that an #ifdef disables a portion of code where `found_console' 
is used, resulting in the above error. Later on I get a similar error regarding 
a function that is 'defined but never used'.

I attach a patch that fixes this issues by moving the variable declaration and 
function *inside* the #ifdef - #endif block.

Cheers,
Stathis
>How-To-Repeat:
Try to build GENERIC_TINY under -current.
>Fix:
[stathis@voyager /usr/src/sys/arch/x86/x86] cvs diff
cvs diff: Diffing .
Index: x86_autoconf.c
===================================================================
RCS file: /cvsroot/src/sys/arch/x86/x86/x86_autoconf.c,v
retrieving revision 1.40
diff -r1.40 x86_autoconf.c
71a72
> #if NPCI > 0
79a81
> #endif
505,506d506
<       static bool found_console = false;
< 
554a555,556
>       static bool found_console = false;
> 
[stathis@voyager /usr/src/sys/arch/x86/x86] 



Home | Main Index | Thread Index | Old Index