This is the mail archive of the gcc-bugs@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/8093: Wrong warning by gcc suggests adding dead code to end of function


>Number:         8093
>Category:       c
>Synopsis:       Wrong warning by gcc suggests adding dead code to end of function
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    unassigned
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Mon Sep 30 05:25:59 PDT 2002
>Closed-Date:
>Last-Modified:
>Originator:     Andreas Aardal Hanssen
>Release:        gcc version 2.96 20000731 (gcc-c++-2.96-112)
>Organization:
>Environment:
Linux, bash
>Description:
gcc gives a wrong warning when compiling the attached file
with -Wall.

It falsely claims that the control reaches the end of a
non-void function, when control can never reach the end.
>How-To-Repeat:
gcc -Wall test.cc -o test
>Fix:
?
>Release-Note:
>Audit-Trail:
>Unformatted:
----gnatsweb-attachment----
Content-Type: application/octet-stream; name="test.cc"
Content-Transfer-Encoding: base64
Content-Disposition: attachment; filename="test.cc"

I2luY2x1ZGUgPHN0ZGlvLmg+CgppbnQgdGhlc2FtZWFzKGludCBhKSAKewogIGlmIChhICE9IDEg
JiYgYSAhPSAyICYmIGEgIT0gMyAmJiBhICE9IDQpCiAgICByZXR1cm4gLTE7CgogIGlmIChhID09
IDEpCiAgICByZXR1cm4gMTsKCiAgaWYgKGEgPT0gMikKICAgIHJldHVybiAyOwoKICBpZiAoYSA9
PSAzKQogICAgcmV0dXJuIDM7CgogIGlmIChhID09IDQpCiAgICByZXR1cm4gNDsKfQoKaW50IG1h
aW4oaW50IGFyZ2MsIGNoYXIgKiphcmd2KSB7CgogIHByaW50ZigiJWkgaXMgdGhlIHNhbWUgYXMg
JWlcbiIsIDEsIDMpOwoKCn0K


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