CompuServe Messages

#ADDRESS etc, question

    26-Jul-89 23:15:58
Sb: #ADDRESS etc, question
Fm: Richard Bielak 75716,352
To: avant-garde
Leon, I have a question about BM2 compiler. I looked in the manual but couldn't find a clear answer. Is this code legal Modula-2? VAR p1, p2 : ADDRESS; p1 := ADDRESS(p2^); Since ADDRESS is defined to be a POINTER to BYTE, this code doesn't do what I expected. It takes a BYTE pointed to by "p2" and extends it to a LONGWORD, nd the places result in "p1". A spectacular crashes follow soon after. This type transfer should be illegal since the variables are not of the same size (i.e. one is BYTE and the other is ADDRESS). This is according to Wirth. BTW, this code occured in a module that I was porting from a VAX, where ADDRESS is defined as POINTER TO LONGWORD. Comments? …. Richie