Subject: port-alpha/3467: trap.c fails to compile w/o option DIAGNOSTICS
To: None <gnats-bugs@gnats.netbsd.org>
From: John Franklin <franklin@elfie.bevc.blacksburg.va.us>
List: netbsd-bugs
Date: 04/09/1997 09:43:57
>Number:         3467
>Category:       port-alpha
>Synopsis:       trap.c fails to compile w/o option DIAGNOSTICS
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    gnats-admin (GNATS administrator)
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Wed Apr  9 06:50:01 1997
>Last-Modified:
>Originator:     John Franklin
>Organization:
>Release:        NetBSD-current April 5 tar-balls
>Environment:
System: NetBSD elfie.bevc.blacksburg.va.us 1.2C NetBSD 1.2C (YOSSARIAN) #1: Thu Oct 1 14:06:20 PDT 1970 root@elfie.bevc.blacksburg.va.us:/usr/src/sys/arch/alpha/compile/YOSSARIAN alpha


>Description:

Compiling a port-alpha kernel without option DIAGNOSTICS removes an assign
statement in trap.c (code frag shown below) and generates from gcc:

cc1: warnings being treated as errors
../../../../arch/alpha/alpha/trap.c: In function `trap':
../../../../arch/alpha/alpha/trap.c:124: warning: `sticks' might be used uninitialized in this function

Code frag:
        if (user)  {
                sticks = p->p_sticks;
                p->p_md.md_tf = framep;
        } else {
#ifdef DIAGNOSTIC
                sticks = 0xdeadbeef;            /* XXX for -Wuninitialized */
#endif
        }


>How-To-Repeat:

Config a kernel without option DIAGNOSTICS and try to build it.

>Fix:

Either don't #ifdef the block, or add a #else segment setting sticks to
some other value. (perhaps NULL?)
>Audit-Trail:
>Unformatted: