Bug 71972

Summary: "make buildkernel" fails when "options RESTARTABLE_PANICS" is set
Product: Base System Reporter: Pavel Gubin <pg>
Component: miscAssignee: John Baldwin <jhb>
Status: Closed FIXED    
Severity: Affects Only Me    
Priority: Normal    
Version: Unspecified   
Hardware: Any   
OS: Any   

Description Pavel Gubin 2004-09-21 14:10:13 UTC
When "options RESTARTABLE_PANICS" is enabled, gcc finds a warnings in
many source modules, like this:
..
/src/sys/fs/devfs/devfs_devs.c: In function `devfs_itor':
/src/sys/fs/devfs/devfs_devs.c:82: warning: control reaches end of non-void function
..
and then build fails because of -Werror.

The warnings like this one also found in:
/sys/kern/kern_intr.c
/sys/kern/subr_bus.c
/sys/kern/subr_witness.c

and possibly other places.

The warnings are appeared because RESTARTABLE_PANICS changes panic() prototype definition in sys/systm.h:324:

#ifdef RESTARTABLE_PANICS
void    panic(const char *, ...) __printflike(1, 2);
#else
void    panic(const char *, ...) __dead2 __printflike(1, 2);
#endif

Fix: 

I've tried to quickly fix a problem by inserting `for(;;);' aftel call to panic() in the files which are failed to compile, but after a 4 or 5 fixes decided that there must be 'a more right way' to fix this.
How-To-Repeat: Add an "options RESTARTABLE_PANICS" line into kernel configfile, then "make buildkernel" breaks.
Comment 1 ru freebsd_committer freebsd_triage 2005-02-17 10:06:08 UTC
Responsible Changed
From-To: freebsd-bugs->jhb

Over to the author of RESTARTABLE_PANICS.
Comment 2 John Baldwin freebsd_committer freebsd_triage 2005-02-18 15:18:25 UTC
If you are using this option (it's not a "quick fix" for kernel panics), then 
you should be able to figure out how to turn this warning off or turn -Werror 
off from the Makefiles.  Having it not work out of the box is a feature 
rather than a bug. :)

-- 
John Baldwin <jhb@FreeBSD.org>  <><  http://www.FreeBSD.org/~jhb/
"Power Users Use the Power to Serve"  =  http://www.FreeBSD.org
Comment 3 John Baldwin freebsd_committer freebsd_triage 2005-04-15 00:43:27 UTC
State Changed
From-To: open->closed

Current behavior is the desired behavior.