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: | 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)
Change History (12)
comment:1 by , 12 years ago
comment:2 by , 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 , 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 , 11 years ago
Milestone: | Boost 1.43.0 → To Be Determined |
---|---|
Severity: | Problem → Cosmetic |
Version: | Boost 1.44.0 → Boost 1.47.0 |
comment:5 by , 11 years ago
if I use those pragmas I'm getting segfaults with boost program_options.
comment:6 by , 10 years ago
Cc: | added |
---|
comment:7 by , 10 years ago
I just ran in to this, too. How about fixing it by removing the second const?
by , 10 years ago
Attachment: | map_iterator.patch added |
---|
Patch for this issue that removes the second 'const'
any progress here? that warning is annoying :(