This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
c/5035: Incorrectly produces '`<var>' might be used uninitialized in this function'
- From: thutt at vmware dot com
- To: gcc-gnats at gcc dot gnu dot org
- Date: 6 Dec 2001 17:09:14 -0000
- Subject: c/5035: Incorrectly produces '`<var>' might be used uninitialized in this function'
- Reply-to: thutt at vmware dot com
>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==