NO

Author Topic: forward declarations  (Read 4964 times)

japheth

  • Guest
forward declarations
« on: January 20, 2007, 01:58:35 pm »
Hello,

Unlike MASM Poasm does not allow to declare a pointer to a type which is not - yet - known. Test case:

Code: [Select]

        .386
        .MODEL flat, stdcall

LPSTRUCT1 typedef ptr STRUCT1

Func1 proto :ptr STRUCT1

STRUCT1 struct
dd ?
STRUCT1 ends

.DATA
s1 STRUCT1 <>
        .CODE
mov eax, offset s1
        ret
        END


MASM assembles without errors, PoASM gives 2 errors saying

invalid use of 'STRUCT1'

Would be really good if this issue can be fixed.

Regards

Japheth

Offline Pelle

  • Administrator
  • Member
  • *****
  • Posts: 1974
    • http://www.smorgasbordet.com
forward declarations
« Reply #1 on: January 22, 2007, 02:35:48 pm »
I will add it if it's an easy change... (not sure about the incomplete type it will introduce, though)
/Pelle

japheth

  • Guest
forward declarations
« Reply #2 on: January 22, 2007, 05:49:03 pm »
Hi,

> I will add it if it's an easy change... (not sure about the incomplete type it will introduce, though)

Thanks!

if you don't have time for testing, you can pm me and I will do the tests.

The "incomplete" type is an issue, that's true, but MASM also isn't able to handle that properly.

Regards

Japheth

Offline Pelle

  • Administrator
  • Member
  • *****
  • Posts: 1974
    • http://www.smorgasbordet.com
forward declarations
« Reply #3 on: January 22, 2007, 10:37:49 pm »
Quote from: "japheth"
The "incomplete" type is an issue, that's true, but MASM also isn't able to handle that properly.

No, but I need to be able to represent the incomplete type until later, when/if it is defined, and doing this without having to add tons of additional checks to catch the use of such incomplete type.

I'm doing some other work at the moment, I will look closer at this later...
/Pelle