On Wed, May 30, 2007 at 09:06:08AM +0200, Geert Uytterhoeven wrote: [...] > > > > > > I think it could be tightened up even if it happens not to warn? > > > > > > struct a { > > struct not_yet_defined *start, *end; > > }; > > > > struct not_yet_defined { > > void *foo; > > }; > > > > Is a valid and gives no warnings. > > I was puzzled by this as well, as there were no compiler warnings... Pointers are (at least on m68k) of known size, so the compiler knows how much space the struct occupies. Type checking is by definition futile with void * pointer, but for all other cases the compiler has all types and sizes it needs at this point. The actual dereferencing of the symbol table is done by the linker, which also knows all locations and sizes it needs. Actually, this is the only way to define circular referencing structures. A one-pass-compiler-linker would run into problems. Joerg, trying to recall compiler construction lessons
Attachment:
signature.asc
Description: Digital signature
- Follow-Ups:
- Re: [patch 1/2] m68k: runtime patching infrastructure
- From: Geert Uytterhoeven <[email protected]>
- Re: [patch 1/2] m68k: runtime patching infrastructure
- References:
- [patch 0/2] A few more m68k patches
- From: Geert Uytterhoeven <[email protected]>
- [patch 1/2] m68k: runtime patching infrastructure
- From: Geert Uytterhoeven <[email protected]>
- Re: [patch 1/2] m68k: runtime patching infrastructure
- From: Andrew Morton <[email protected]>
- Re: [patch 1/2] m68k: runtime patching infrastructure
- From: Eric Dumazet <[email protected]>
- Re: [patch 1/2] m68k: runtime patching infrastructure
- From: Geert Uytterhoeven <[email protected]>
- [patch 0/2] A few more m68k patches
- Prev by Date: [PATCH] merge dst_discard in & out into one, removed a duplicate function
- Next by Date: Re: [RFC] LZO de/compression support - take 6
- Previous by thread: Re: [patch 1/2] m68k: runtime patching infrastructure
- Next by thread: Re: [patch 1/2] m68k: runtime patching infrastructure
- Index(es):