From thomas@cuivre.fr.eu.org  Thu Feb 28 09:09:53 2002
Return-Path: <thomas@cuivre.fr.eu.org>
Received: from melchior.cuivre.fr.eu.org (melchior.enst.fr [137.194.161.6])
	by hub.freebsd.org (Postfix) with ESMTP id 6EAC037B405
	for <FreeBSD-gnats-submit@freebsd.org>; Thu, 28 Feb 2002 09:09:52 -0800 (PST)
Received: from melusine.cuivre.fr.eu.org (melusine.enst.fr [137.194.160.34])
	by melchior.cuivre.fr.eu.org (Postfix) with ESMTP id B5D328438
	for <FreeBSD-gnats-submit@freebsd.org>; Thu, 28 Feb 2002 18:09:50 +0100 (CET)
Received: by melusine.cuivre.fr.eu.org (Postfix, from userid 1000)
	id 94E512C3D1; Thu, 28 Feb 2002 18:09:49 +0100 (CET)
Message-Id: <20020228170949.94E512C3D1@melusine.cuivre.fr.eu.org>
Date: Thu, 28 Feb 2002 18:09:49 +0100 (CET)
From: Thomas Quinot <thomas@cuivre.fr.eu.org>
Reply-To: Thomas Quinot <thomas@cuivre.fr.eu.org>
To: FreeBSD-gnats-submit@freebsd.org
Cc:
Subject: es137x.c warning causes buildkernel failure [patch]
X-Send-Pr-Version: 3.113
X-GNATS-Notify:

>Number:         35408
>Category:       kern
>Synopsis:       es137x.c warning causes buildkernel failure [patch]
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    freebsd-bugs
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Thu Feb 28 09:10:01 PST 2002
>Closed-Date:    Mon Apr 15 07:44:00 PDT 2002
>Last-Modified:  Mon Apr 15 07:44:00 PDT 2002
>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:
State-Changed-From-To: open->closed 
State-Changed-By: roberto 
State-Changed-When: Mon Apr 15 07:43:39 PDT 2002 
State-Changed-Why:  
Patch applied, thanks!  

http://www.freebsd.org/cgi/query-pr.cgi?pr=35408 
>Unformatted:
