Boost logo

Boost Users :

From: Jens Seidel (jensseidel_at_[hidden])
Date: 2007-08-13 11:03:22


On Mon, Aug 13, 2007 at 09:16:20AM +0000, gast128 wrote:
> Fei Liu <fei.liu <at> aepnetworks.com> writes:
> > I am getting multiple warning messages like the following from boost
> > serialization library:
> > /usr/include/boost/archive/detail/iserializer.hpp:124: warning: unused
> > parameter 'flags'
> >
> > I am pretty sure this is a common issue but I haven't found any clue
> > through the web. Is there a way to turn off the warning through proper
> > coding? I am using gcc on linux.

The simplest way is to fix the code! These warning are not useless, you
will profit from it a lot.

I assume you talk about unused variable arguments such as
int test(int var)
{
  return 1;
}

This code would using -Wall -Wextra (this warning level should be used
as default, it is really good) complain about an unused "var". I suggest
to check the code, maybe it's wrong. If all is right, you can replace it
to

int test(int /*var*/)
{
  return 1;
}

> We are not using gcc here, but with Visual Studio one can supress these
> warnings like (example of using text archives):

I'm confused! You prefer to work with a proprietary program instead of a
completly free one which even is much more standard conform has much
more features (I can simple create a cross compiler, ...)? I'm really
confused ...

> #pragma warning(push)
> #pragma warning(disable: 4100)

I strongly suggest not to use any pragmas as this is compiler specific.
Changing code would have affect on each compiler. There is only one
pragma I ever used in my life, only one: #pragma omp for OpenMp
parallelisation in GCC 4.2+.

Jens


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