Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 28 Feb 2002 18:09:49 +0100 (CET)
From:      Thomas Quinot <thomas@cuivre.fr.eu.org>
To:        FreeBSD-gnats-submit@freebsd.org
Subject:   kern/35408: es137x.c warning causes buildkernel failure [patch]
Message-ID:  <20020228170949.94E512C3D1@melusine.cuivre.fr.eu.org>

next in thread | raw e-mail | index | archive | help

>Number:         35408
>Category:       kern
>Synopsis:       es137x.c warning causes buildkernel failure [patch]
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    freebsd-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Thu Feb 28 09:10:01 PST 2002
>Closed-Date:
>Last-Modified:
>Originator:     Thomas Quinot
>Release:        FreeBSD 5.0-CURRENT i386
>Organization:
>Environment:
System: FreeBSD shalmaneser.enst.fr 5.0-CURRENT FreeBSD 5.0-CURRENT #3: Tue Feb  5 19:14:04 CET 2002     quinot@shalmaneser.enst.fr:/usr/obj/usr/src/sys/SHALMANESER  i386


Compiler: gcc 2.95.3.

>Description:
	es137x.c generates a warning. Since -Werror is enabled by default,
	this causes buildkernel to fail:

cc -c -O2 -pipe  -Wall -Wredundant-decls -Wnested-externs -Wstrict-prototypes  -Wmissing-prototypes -Wpointer-arith -Winline -Wcast-qual  -fformat-extensions -ansi -g -nostdinc -I-  -I. -I/usr/src/sys -I/usr/src/sys/dev -I/usr/src/sys/contrib/dev/acpica -I/usr/src/sys/contrib/ipfilter -I/usr/src/sys/../include  -D_KERNEL -ffreestanding -include opt_global.h -fno-common -elf  -mpreferred-stack-boundary=2 -Werror  /usr/src/sys/dev/sound/pci/es137x.c
cc1: warnings being treated as errors
/usr/src/sys/dev/sound/pci/es137x.c: In function `es1371_rdcd':
/usr/src/sys/dev/sound/pci/es137x.c:598: warning: `x' might be used uninitialized in this function

The warning is irrelevant because the variable is actually always assigned
to before use.

>How-To-Repeat:
	make buildkernel on a freshly cvsupped tree.
>Fix:

--- es137x.c	Wed Oct 10 14:57:55 2001
+++ es137x.c.fixed	Thu Feb 28 17:59:45 2002
@@ -595,7 +595,7 @@
 es1371_rdcd(kobj_t obj, void *s, int addr)
 {
   	int sl;
-  	unsigned t, x;
+  	unsigned t, x = 0;
   	struct es_info *es = (struct es_info *)s;
 
   	if (debug > 0) printf("rdcodec addr 0x%x ... ", addr);

>Release-Note:
>Audit-Trail:
>Unformatted:

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-bugs" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20020228170949.94E512C3D1>