More SC++ b…
Hello,
Here are the problems I discovered recently with the Symantec C++ compiler. I
am almost sure these problems were already reported, but just in case…
1) Long floats are not supported? The following code:
void LongFloater(void)
{ long float x; x= x+1; }
produces the error message: "internal error: file ::CG:CDassign.c line 58"
2) Debugger displays a variable with duplicated name incorrectly as in the
following example:
typedef struct S { int a, b; } S;
void getS(S* s)
{ s->a= 1; s->b= 2; }
void main()
{
int i= 2;
S dupple; // here 'dupple' is displayed as the second
'dupple'
getS(& dupple);
if (i > 1) {
S dupple;
getS(&dupple);
}
} 3) A serious bug in the code generator:
class JustAnything {
public:
JustAnything();
int noMatterWhat;
};
JustAnything::JustAnything() : noMatterWhat(0)
{}
class MoreThan32K {
public:
MoreThan32K();
char buf[40000];
JustAnything field;
};
MoreThan32K::MoreThan32K()
{}
The disassemble for MoreThan32K::MoreThan32K() contains the following:
…
MOVEA.L A3,A2 ; move this ->A2
LEA $9C40(A2),A2 ; calculate &this->field.
; ACTUALLY, It is LEA -$63C0(A2),A2, as shown by the MacsBug
; and as executed by the processor
MOVE.L A2,-(A7) ; push &this->field onto stack
JSR JustAnything::JustAnything(void)
… The address of the "field" member is calculated incorrectly (namely,
shifted by -64K). The consequences of this are obvious.
Waiting anxiously for _the_ maintenance release,
//Alexander