Opened 12 years ago

Last modified 6 years ago

#4276 new Bugs

warning "type qualifiers ignored on function return type" in ptr_map

Reported by: boris.bigott@… Owned by: Thorsten Ottosen
Milestone: To Be Determined Component: ptr_container
Version: Boost 1.47.0 Severity: Cosmetic
Keywords: ptr_map Cc: mika.fischer@…

Description

The following program compiled with gcc using options -W and -Wall spits out a warning about ignored type qualifiers.

test.cpp: #include <boost/ptr_container/ptr_map.hpp> int main() { }

g++ -W -Wall test.cpp ../include/boost/ptr_container/detail/map_iterator.hpp:52: warning: type qualifiers ignored on function return type

It seems like there is a superfluous const in the -> operator. const ref_pair* const operator->() const should be const ref_pair* operator->() const

Attachments (1)

map_iterator.patch (351 bytes ) - added by gredner@… 10 years ago.
Patch for this issue that removes the second 'const'

Download all attachments as: .zip

Change History (12)

comment:1 by FloSoft, 12 years ago

any progress here? that warning is annoying :(

comment:2 by ravishankar@…, 11 years ago

Could be avoided by #pragma GCC push_options #pragma GCC diagnostic ignored "-Wignored-qualifiers" #include <boost/ptr_container/ptr_map.hpp> #pragma GCC pop_options

But there is really simple, safety and tiny fix, described above. I can't understand a reason why it isn't fixed still.

comment:3 by dgpickett@…, 11 years ago

Maybe it is a do it yourself repository? I had to clean it up for a fussy build wrapper! Thanks!

comment:4 by FloSoft, 11 years ago

Milestone: Boost 1.43.0To Be Determined
Severity: ProblemCosmetic
Version: Boost 1.44.0Boost 1.47.0

comment:5 by anonymous, 11 years ago

if I use those pragmas I'm getting segfaults with boost program_options.

comment:6 by Mika Fischer <mika.fischer@…>, 10 years ago

Cc: mika.fischer@… added

comment:7 by cjs@…, 10 years ago

I just ran in to this, too. How about fixing it by removing the second const?

by gredner@…, 10 years ago

Attachment: map_iterator.patch added

Patch for this issue that removes the second 'const'

comment:8 by gredner@…, 10 years ago

It would be nice to get this trivial issue taken care of!

comment:9 by anonymous, 8 years ago

+1

comment:10 by martin.dorey@…, 8 years ago

Patch applied here too, our-ref D57661.

comment:11 by anonymous, 6 years ago

This patch works, would be nice if it would get applied

Note: See TracTickets for help on using tickets.