From mint-bounce@lists.fishpool.fi Thu Dec 10 12:17:13 2009 Message-ID: <4B212C6E.50006@freesbee.fr> Date: Thu, 10 Dec 2009 18:14:22 +0100 From: =?ISO-8859-1?Q?Vincent_Rivi=E8re?= User-Agent: Thunderbird 2.0.0.23 (Windows/20090812) MIME-Version: 1.0 To: mint Subject: Re: [MiNT] XaAES modifications and clarification References: <11a6f2b10912100028l6bcb4671xafdac483b5caf82c@mail.gmail.com> <752526d20912100116n162523ecgb412973e2c51ca5f@mail.gmail.com> <4B20C0B5.5010007@freesbee.fr> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed X-Antivirus: avast! (VPS 091210-0, 10/12/2009), Outbound message X-Antivirus-Status: Clean X-ecartis-version: Ecartis v1.0.0 Sender: mint-bounce@lists.fishpool.fi Errors-to: mint-bounce@lists.fishpool.fi X-original-sender: vincent.riviere@freesbee.fr Precedence: bulk List-help: List-unsubscribe: List-Id: X-List-ID: List-subscribe: List-owner: List-post: Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by mail.sparemint.org id nBAHHCfx019740 Miro Kropacek wrote: > Not true. At this time, compiler is already aware of the structure > declaration. That declaration statement is useless. And furthermore, it works also for interdependent structures ! /* This is valid C */ struct A { struct B* b; }; struct B { struct A* a; }; However, I finally found the case where the forward declaration is mandatory. It is in C++, when a struct is referred to without the struct keyword. Without the forward declaration, the compiler can't know where that type come from. // This is valid C++ struct B; struct A { B* b; // This requires the forward declaration of struct B }; struct B { A* a; }; -- Vincent Rivière