<<< Date Index >>>     <<< Thread Index >>>

Re: 1.5.8 build failure on Solaris 8



Brendan Cully writes:
> > This sort of situation (a struct containing a function pointer named
> > after a standard function) tends to bite people fairly often.
> 
> yeah, one of the things that stopped me from just sitting down and
> renaming everything was the fact that DB4 also uses an 'open'
> function pointer, so I figured they must have solved the problem.

Hmmm.  I've just taken a look at their source and documentation, and I
can't see anything that would deal with this issue.

> >   struct s *p = ...;
> >   int fd = (p->open)(name, mode);
> >   (p->close)(fd);
> 
> I actually don't mind this version. In a way I like it better than
> the global rename, even though it's about the same amount of work. It
> makes me feel like the namespace is a little less polluted :)

The thing I really dislike about it is that everyone who will ever work
on such code will need to know about this particular dark corner of C:
at the very least, that a problem exists, and that this is the
workaround for it.  All it takes is for one person to forget, or not to
have known about this in the first place, and suddenly the build breaks
for some people.  Renaming the members seems much safer to me.

-- 
Aaron Crane