This is the mail archive of the gcc-prs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

c/5035: Incorrectly produces '`<var>' might be used uninitialized in this function'



>Number:         5035
>Category:       c
>Synopsis:       Incorrectly produces '`<var>' might be used uninitialized in this function'
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    unassigned
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Thu Dec 06 09:16:01 PST 2001
>Closed-Date:
>Last-Modified:
>Originator:     thutt@vmware.com
>Release:        egcs-2.91.66
>Organization:
>Environment:
uname -a reports     : Linux thutt-lx 2.2.17 #3 Mon Oct 1 20:43:58 PDT 2001 i686 unknown
>Description:
gcc -v -c -O2 -Wall defect.c
Incorrectly produces the following warning:
 defect.c:7: warning: `b' might be used uninitialized in this function

'a' is local and not aliased.
'b' is local and not aliased.

Both uses of 'b' are under the same control conditions; the
compiler should not produce this warning.
>How-To-Repeat:
Follow instructions in source file.
>Fix:

>Release-Note:
>Audit-Trail:
>Unformatted:
----gnatsweb-attachment----
Content-Type: application/octet-stream; name="defect.c"
Content-Transfer-Encoding: base64
Content-Disposition: attachment; filename="defect.c"

LyoKICogZ2NjIC12IC1jIC1PMiAtV2FsbCBkZWZlY3QuYwogKgogKiBJbmNvcnJlY3RseSBwcm9k
dWNlcyB0aGUgZm9sbG93aW5nIHdhcm5pbmc6CiAqIAogKiAgZGVmZWN0LmM6Nzogd2FybmluZzog
YGInIG1pZ2h0IGJlIHVzZWQgdW5pbml0aWFsaXplZCBpbiB0aGlzIGZ1bmN0aW9uCiAqCiAqICAn
YScgaXMgbG9jYWwgYW5kIG5vdCBhbGlhc2VkLgogKiAgJ2InIGlzIGxvY2FsIGFuZCBub3QgYWxp
YXNlZC4KICoKICogIEJvdGggdXNlcyBvZiAnYicgYXJlIHVuZGVyIHRoZSBzYW1lIGNvbnRyb2wg
Y29uZGl0aW9uczsgdGhlCiAqICBjb21waWxlciBzaG91bGQgbm90IHByb2R1Y2UgdGhpcyB3YXJu
aW5nLgogKgogKiBnY2MgLS12ZXJzaW9uIHJlcG9ydHM6IGVnY3MtMi45MS42NgogKiB1bmFtZSAt
YSByZXBvcnRzICAgICA6IExpbnV4IHRodXR0LWx4IDIuMi4xNyAjMyBNb24gT2N0IDEgMjA6NDM6
NTggUERUIDIwMDEgaTY4NiB1bmtub3duCiAqIAogKi8KZXh0ZXJuIGludCBmKHZvaWQpOwoKCmlu
dCBtYWluKHZvaWQpCnsKICAgaW50IGEsIGIsIGM7CgogICBhID0gZigpOwogICAKICAgaWYgKGEp
CiAgIHsKICAgICAgIGIgPSAxMDsKICAgfQoKICAgaWYgKGYoKSkKICAgewogICAgICAgYyA9IDE1
MTsKICAgfQoKICAgaWYgKGEpCiAgICAgICByZXR1cm4gYjsKICAgcmV0dXJuIDA7Cn0KCg==


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]