On Thursday 05 January 2006 11:58, Joe Orton wrote: > On Thu, Jan 05, 2006 at 12:48:25PM +0100, Ruediger Pluem wrote: > > But I remember myself that there had been casting issues in the past that > > created compiler warnings especially with gcc 4. The patch below compiles > > fine with my gcc 3.2.2 with -Wall. So if someone could give a comment > > if > > > > f->ctx = (void *)(1) > > > > is fine it would be great. > > André's trick of using invented unique pointers by doing: > > static char sentinel; (in global scope) > > f->ctx = &sentinel; > > is neater and avoids the casting mess. (pick a suitable variable name > though :)
Why go to the trouble of inventing a pointer? You already have unique pointers in global scope. An obvious example: module some_module; f->ctx = &some_module; -- Nick Kew