![]() |
Rekursive Typdefinition und keine Compilerfehler
Folgende Typdefinition wird vom Delphi6/2005-Compiler anstandslos kompiliert
Delphi-Quellcode:
Das Problem ist klar: Ein Typ kann nicht ein Zeigertyp von sich selbst ein (jedoch versehentlich so eingetippt).
type
TMyTyp = record Size: Integer; Var1: PWideChar end; type TPMyTyp = ^TPMyTyp; Jedoch kommt nach einiger Zeit wenn die IDE im Hintergrund weiterkompiliert ein Stabelüberlauffehler (D6) wobei die IDE teilweise einfach verschwindet. |
Re: Rekursive Typdefinition und keine Compilerfehler
Hi,
das ist auch bei Delphi 4 so, macht da allerdings keine Probleme. Abgesehen davon, dass sich so ein Typ IMHO nicht sinnvoll verwenden lässt, spricht aber ja auch nichts gegen ihn, solange die Typprüpfung dabei nicht aus dem Tritt gerät. |
Alle Zeitangaben in WEZ +1. Es ist jetzt 16:20 Uhr. |
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO © 2011, Crawlability, Inc.
Delphi-PRAXiS (c) 2002 - 2023 by Daniel R. Wolf, 2024-2025 by Thomas Breitkreuz