Subject: port-alpha/3467: trap.c fails to compile w/o option DIAGNOSTICS
To: None <>
From: John Franklin <>
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
>Originator:     John Franklin
>Release:        NetBSD-current April 5 tar-balls
System: NetBSD 1.2C NetBSD 1.2C (YOSSARIAN) #1: Thu Oct 1 14:06:20 PDT 1970 alpha


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 {
                sticks = 0xdeadbeef;            /* XXX for -Wuninitialized */


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


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