Thread View: gnu.gcc.bug
1 messages
1 total messages
Started by A.APPLEYARD
Wed, 19 Aug 1992 09:57
Gnu C++ bugs in classes
Author: A.APPLEYARD
Date: Wed, 19 Aug 1992 09:57
Date: Wed, 19 Aug 1992 09:57
40 lines
1542 bytes
1542 bytes
BUG REPORT: In Gnu C version 2.0, static members of classes are not allocated
storage space, and thus the linker complains that these symbols are missing if
I use them.
This bug was not present in the last version of Gnu C which I had (1.39?).
Herewith a C++ program, and its translation into assembler by Gnu C++.
Notice that there is no assembler line 'comm __12mousecatcher$mice,4'.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
class mousecatcher{public:
int cat,ferret,owl,trap;
static int mice;};
int i,j,k; mousecatcher Tom;
main(){i=Tom.cat; j=Tom.ferret; k=Tom.mice;}
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
.file "t$$.cc"
gcc2_compiled.:
.text
.align 2
.globl _main
_main:
pushl %ebp
movl %esp,%ebp
call ___main
movl _Tom,%edx
movl %edx,_i
movl _Tom+4,%edx
movl %edx,_j
movl __12mousecatcher$mice,%edx
movl %edx,_k
xorl %eax,%eax
jmp L1
.align 2,0x90
jmp L1
.align 2,0x90
L1:
leave
ret
.comm _i,4
.comm _j,4
.comm _k,4
.comm _Tom,16
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