Opened 9 years ago

Closed 8 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@…


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]â:   instantiated from here
/home/yang/work/boost/boost/any.hpp:200: warning: type qualifiers ignored on function return type

Attachments (0)

Change History (5)

comment:1 Changed 9 years ago by Yang Zhang <yang.boostbugs@…>

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

comment:2 Changed 9 years ago by vladimir_prus

  • Component changed from program_options to any
  • 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 Changed 9 years ago by vladimir_prus

  • Owner changed from nasonov to no-maintainer

comment:4 Changed 8 years ago by Sascha Ochsenknecht <s.ochsenknecht@…>

  • Cc s.ochsenknecht@… added
  • Component changed from any to program_options
  • Owner changed from no-maintainer to vladimir_prus


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

comment:5 Changed 8 years ago by s_ochsenknecht

  • Resolution set to fixed
  • Status changed from new to closed

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

Add Comment

Modify Ticket

Change Properties
Set your email in Preferences
as closed The owner will remain vladimir_prus.
The resolution will be deleted. Next status will be 'reopened'.

E-mail address and user name can be saved in the Preferences.

Note: See TracTickets for help on using tickets.