Boost logo

Boost Users :

From: Peter Klotz (Peter.Klotz_at_[hidden])
Date: 2008-08-20 17:03:08


> -----Ursprüngliche Nachricht-----
> Von: boost-users-bounces_at_[hidden] [mailto:boost-users-
> bounces_at_[hidden]] Im Auftrag von Emil Dotchevski
> Gesendet: Mittwoch, 20. August 2008 19:47
> An: boost-users_at_[hidden]
> Betreff: Re: [Boost-users] [Exception] 1.36.0: mutable Patch
>
> On Wed, Aug 20, 2008 at 7:19 AM, Peter Klotz
> <Peter.Klotz_at_[hidden]> wrote:
> >
> > gcc 3.2 complains heavily about keyword mutable not being at the
> beginning of declarations.
> >
> > The attached patch fixes that.
> >
> > The C++ standard does not enforce mutable placement however since Boost
> is already full of compiler specific workarounds I would be happy if this
> patch could be applied.
>
> May I see a log with the warnings you're getting and the command line
> you're using?

The warnings:

In file included from boost/exception/enable_current_exception.hpp:9,
                 from boost/throw_exception.hpp:40,
                 from boost/regex/v4/regex_workaround.hpp:40,
                 from boost/regex/v4/regex.hpp:32,
                 from boost/regex.hpp:31,
                 from main.cpp:2:
boost/exception/exception.hpp:108: warning: `mutable' is not at beginning of declaration
In file included from boost/throw_exception.hpp:40,
                 from boost/regex/v4/regex_workaround.hpp:40,
                 from boost/regex/v4/regex.hpp:32,
                 from boost/regex.hpp:31,
                 from main.cpp:2:
boost/exception/enable_current_exception.hpp:101: warning: `mutable' is not at beginning of declaration

We use compiler switch -W.

According to the documentation for -W:

  Print extra warning messages for these events:

  ...
  Storage-class specifiers like "static" are not the first things
  in a declaration. According to the C Standard, this usage is
  obsolescent.
  ...

It seems that the warning is also generated in C++ mode although I do not see this requirement in C++98 7.1 (1). gcc 4.1 produces no warning for this code.

I cannot turn off -W since this would suppress several other interesting warnings. There seems to be no switch to specifically get rid of this mutable message.

Regards, Peter.


Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net