Opened 14 years ago

Closed 13 years ago

#2562 closed Bugs (fixed)

warning: type qualifiers ignored on function return type

Reported by: Yang Zhang <yang.boostbugs@…> Owned by: Vladimir Prus
Milestone: Boost 1.38.0 Component: program_options
Version: Boost 1.37.0 Severity: Problem
Keywords: Cc: s.ochsenknecht@…

Description

Sample source:

#include <boost/program_options.hpp>
namespace po = boost::program_options;
int main() {
  int x;
  po::options_description desc("");
  desc.add_options()("x,x", po::value<int>(&x)->default_value(2), "x");
  return 0;
}

Building with -Wignored-qualifiers on g++ 4.3.2 on Ubuntu 8.10 x86_64.

/home/yang/work/boost/boost/any.hpp: In member function âvoid boost::program_options::typed_value<T, charT>::notify(const boost::any&) const [with T = int, charT = char]â:
boost_program_options_warning.cc:8:   instantiated from here
/home/yang/work/boost/boost/any.hpp:200: warning: type qualifiers ignored on function return type

Change History (5)

comment:1 by Yang Zhang <yang.boostbugs@…>, 14 years ago

Whoops, I meant to mark this as a bug in svn trunk.

comment:2 by Vladimir Prus, 14 years ago

Component: program_optionsany
Owner: changed from Vladimir Prus to nasonov

This is problem with boost::any, not program_options, so I'm changing component. Note that IIUC, boost::any is not actively maintained, so I'm not sure if this will be fixed soon. Note also that I don't have any opinion whether this warning is a actual problem with boost::any, or a bogus warning.

comment:3 by Vladimir Prus, 14 years ago

Owner: changed from nasonov to No-Maintainer

comment:4 by Sascha Ochsenknecht <s.ochsenknecht@…>, 13 years ago

Cc: s.ochsenknecht@… added
Component: anyprogram_options
Owner: changed from No-Maintainer to Vladimir Prus

Sorry,

but I think it is a problem in program_options, solution can be found in here: #3603

comment:5 by Sascha Ochsenknecht, 13 years ago

Resolution: fixed
Status: newclosed

(In [57800]) remove compile warnings, Fixes #2562

Note: See TracTickets for help on using tickets.