From: John Maddock (john_at_[hidden])
Date: 2004-06-28 06:24:06


> > > I get ugly warnings (they look dangerous to me) when I compile
boost/regex
> > > on AIX and HP-UX with gcc.
> >
> > I've never seen anything quite like that before - those tables are
> > immutable, so multiple copies won't hurt if that's what's happening -
but
> > you really need to contact a gcc newsgroup and find out what those
messages
> > actually mean.
> >
> > Thanks,
> >
> > John Maddock.
>
> While searching for this warning message, I found for example:
>
> http://listarchives.boost.org/MailArchives/boost-users/msg03526.php
> http://mail.python.org/pipermail/c++-sig/2003-May/004138.html
> http://gcc.gnu.org/ml/gcc/1998-04/msg00819.html
>
> So it seems, that weak symbols/weak linking does not work with all object
> file formats (only with ELF?).

Hmmm, the thing is I can't really work around this: the regex lib has a
bunch of class-template-specific static data (basically pointers to member
functions) that it needs to be able to dispatch to the correct matcher. The
warning message is wrong for several reasons IMO:

1) the function isn't inline.
2) the initialiser list can not be omitted because the data is *const*.
3) the semantics of the function should be OK, since the shared data is
const and immutable, so multiple copies are OK.

I guess you could suppress the warning by removing the "static" declarator
for these problem platforms, but it's a fix that really should not be
required, otherwise just ignore the warnings if that's acceptable to you...

John