middle-end/6033: Naming and returning a value from a void function causes an internal compiler error (g++)
hezamu@tuug.org
hezamu@tuug.org
Thu Mar 21 23:46:00 GMT 2002
>Number: 6033
>Category: middle-end
>Synopsis: Naming and returning a value from a void function causes an internal compiler error (g++)
>Confidential: no
>Severity: non-critical
>Priority: low
>Responsible: unassigned
>State: open
>Class: sw-bug
>Submitter-Id: net
>Arrival-Date: Thu Mar 21 23:46:01 PST 2002
>Closed-Date:
>Last-Modified:
>Originator: Henri Muurimaa
>Release: g++ 2.95.2
>Organization:
>Environment:
Debian Linux 2.2r5
>Description:
If I have a function returning void but name its return value, and have it return it, ie:
void foo() return retval
{
return retval
}
I get a internal compiler error:
foo.c: In function `void foo()':
foo.c:3: Internal compiler error in `expand_expr', at expr.c:5771
Please submit a full bug report.
See <URL:http://www.gnu.org/software/gcc/bugs.html> for instructions.
This is probably a trivial bug (I haven't looked at the source), but the compiler asked me to report the bug, so here you are.
>How-To-Repeat:
Type the trivial example function shown in the bug description to a file, and try to compile it with g++
>Fix:
Naming a void function's return value is obviously a stupid mistake from the coder's part, so to avoid the problem, don't do stupid mistakes :)
>Release-Note:
>Audit-Trail:
>Unformatted:
More information about the Gcc-prs
mailing list