Vinzent Hoefler wrote:
On Thursday 19 October 2006 08:31, Marc Weustink wrote:
The case shows that users can do this. There is no language construct
that forbids it. So optimizing this with a smart linker may break
such code.
Yes, it may. So what?
There's hell a lot of code that is generally possible within the
language. Still it can be unportable, plain wrong, only work in certain
situations etc. pp. Read: It still may break.
I'm speaking about correct and portable code working in all situations.
The only point is that the linker doesn't recognize the reference being
used.
So "no language construct that forbids it" is no excuse, especially when
you're digging around in internal compiler constructs.
I'm not digging in internal compiler constructs, I'm using a defined
class layout and RTTI. No internal magic is used. (unless you define
RTTI as internal)
Otherwise I'd expect some of my old code to work with FreePascal - where
I outsmarted TPs heap manager to be able to free parts of dynamically
allocated arrays.
IMO, ppl will always be smarter and find a valid case where things get
broken.
This highly depends on your definition of "valid". My opinion: If it
ain't guaranteed by the language, it ain't valid.
A valid case is a piece of code where you and I will agree on that is
should work.
The only thing guaranteed by the language is that if you follow its
definitions, it will compile. Nothing more nothing less.
Marc
_______________________________________________
fpc-devel maillist - fpc-devel@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-devel