NetBSD Problem Report #48185

From www@NetBSD.org  Thu Sep  5 18:39:04 2013
Return-Path: <www@NetBSD.org>
Received: from mail.netbsd.org (mail.netbsd.org [149.20.53.66])
	(using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits))
	(Client CN "mail.NetBSD.org", Issuer "Postmaster NetBSD.org" (verified OK))
	by mollari.NetBSD.org (Postfix) with ESMTPS id 9681371008
	for <gnats-bugs@gnats.NetBSD.org>; Thu,  5 Sep 2013 18:39:04 +0000 (UTC)
Message-Id: <20130905183903.6AEF67119B@mollari.NetBSD.org>
Date: Thu,  5 Sep 2013 18:39:03 +0000 (UTC)
From: justin@specialbusservice.com
Reply-To: justin@specialbusservice.com
To: gnats-bugs@NetBSD.org
Subject: compile error: may be used uninitialized in this function
X-Send-Pr-Version: www-1.0

>Number:         48185
>Category:       lib
>Synopsis:       compile error: may be used uninitialized in this function
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    lib-bug-people
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Thu Sep 05 18:40:00 +0000 2013
>Originator:     Justin Cormack
>Release:        cvs 20130812 1030UTC
>Organization:
>Environment:
cross compile form gcc version 4.4.7 20120313 (Red Hat 4.4.7-3) (GCC)
>Description:
cross compiling libc I get

libc/stdio/vfwscanf.c: In function '__vfwscanf_unlocked_l':
libc/stdio/vfwscanf.c:154: error: 'p' may be used uninitialized in this function

*** Failed target:  vfwscanf.o

Looking at it, it is a pretty complex function, I cannot see an error, but adding an initialisation is harmless as it will be optimised out by a compiler that can see that it is not used first. Adding p = NULL solves all the issues.
>How-To-Repeat:

>Fix:
add p = NULL at top of function.

NetBSD Home
NetBSD PR Database Search

(Contact us) $NetBSD: query-full-pr,v 1.39 2013/11/01 18:47:49 spz Exp $
$NetBSD: gnats_config.sh,v 1.8 2006/05/07 09:23:38 tsutsui Exp $
Copyright © 1994-2007 The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.