Thread View: gnu.g++.bug
1 messages
1 total messages
Started by David Callahan
Sun, 26 Nov 1989 18:41
Invalid branch past temporary initialization
Author: David Callahan
Date: Sun, 26 Nov 1989 18:41
Date: Sun, 26 Nov 1989 18:41
37 lines
1679 bytes
1679 bytes
Config.g++ sun3-nfp-os4.
A goto crosses initialization of compiler generated temporary which
generates an error messages and aborts compilation.
A work-around is to wrap the assignment in "a" in braces.
--------- file: gnu-bug1.c ----------
struct temp {
int i ;
temp() ;
temp operator+(temp&) ;
} ;
extern int test() ;
extern "C" int exit(int) ;
main() {
temp a,b,c,d ;
if(test()) goto done ;
a = b+c+d ;
done:
exit(1) ;
}
----------- Sample compilation -----------
cd /home/tera/david/Cfront/
g++ -v -c gnu-bug1.c
gcc version 1.36.1 (based on GCC 1.36)
/usr/local/lib/g++-1.36.1/gcc-cpp -+ -v -undef -D__GNUC__ -D__GNUG__ -D__cplusplus -Dmc68000 -Dsun -Dunix -D__mc68000__ -D__sun__ -D__unix__ -Dmc68020 gnu-bug1.c /usr/tmp/cca00984.cpp
GNU CPP version 1.36
/usr/local/lib/g++-1.36.1/gcc-cc1plus /usr/tmp/cca00984.cpp -quiet -dumpbase gnu-bug1.c -version -o /usr/tmp/cca00984.s
GNU C++ version 1.36.1 (based on GCC 1.36) (68k, MIT syntax) compiled by GNU C version 1.36.
default target switches: -m68020 -mc68020 -mbitfield
gnu-bug1.c: In function int main ():
gnu-bug1.c:15: invalid jump to label `done'
gnu-bug1.c:14: crosses initialization of `_$tmp_0'
Compilation exited abnormally with code 1 at Sun Nov 26 10:31:25
Thread Navigation
This is a paginated view of messages in the thread with full content displayed inline.
Messages are displayed in chronological order, with the original post highlighted in green.
Use pagination controls to navigate through all messages in large threads.
Back to All Threads