Thanks for the detailed explanation. In my opinion the following code should fix the issue:
No... thank you for your efforts to find a solution.
What you suggested works but I cannot use it because the test is dependent on the variable name. If the variable name is different then that test won't work. I need to prevent the use of the empty record type regardless of what the variable name is.
I still think PTR_TO_OPAQUE_TYPE = type pointer; is the (a) solution.
<snip>
The above should do in most cases, since it is also a distinct type.
That will work because the pointer is no longer pointing to an empty record type.
I was hoping there was a way to declare the pointer as being a pointer to an empty record type because that makes it easier to keep track of record layouts that I still need to figure out, e.g, have a { TODO } between the "record" and "end;".
@Kays,
As Thaddy mentioned, I cannot use "restricted" because I'm not using the "extended pascal" mode.
I'll just declare the pointer as a plain pointer instead of as a pointer to an empty record and put a { TODO } comment next to it.
Thank you all for your help.