NetBSD-Bugs archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

lib/48185: compile error: may be used uninitialized in this function



>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.



Home | Main Index | Thread Index | Old Index