Modify

Opened 10 years ago

Closed 10 years ago

#1488 closed Bugs (fixed)

Lots of warnings in ptr_container header files

Reported by: rcdailey@… Owned by: nesotto
Milestone: To Be Determined Component: ptr_container
Version: Boost Development Trunk Severity: Problem
Keywords: Cc:

Description

I'm getting many warnings in a few ptr_container related header files in boost. Below are the warnings I'm getting. My IDE is Visual Studio 2008 (VS9). These also occur on Visual Studio 2005 (VS8):

1>c:\it\personal\collision\sdk\boost\boost\ptr_container\detail\move.hpp(23) : warning C4512: 'boost::ptr_container_detail::move_ptrs::move_source<Ptr>' : assignment operator could not be generated
1>        with
1>        [
1>            Ptr=boost::ptr_container_detail::static_move_ptr<Object,boost::ptr_container_detail::clone_deleter<boost::ptr_container_detail::reversible_ptr_container<boost::ptr_container_detail::sequence_config<Object,std::vector<void *,std::allocator<void *>>>,boost::heap_clone_allocator>::null_clone_allocator<false>>>
1>        ]
1>        c:\it\personal\collision\sdk\boost\boost\ptr_container\ptr_sequence_adapter.hpp(182) : see reference to class template instantiation 'boost::ptr_container_detail::move_ptrs::move_source<Ptr>' being compiled
1>        with
1>        [
1>            Ptr=boost::ptr_container_detail::static_move_ptr<Object,boost::ptr_container_detail::clone_deleter<boost::ptr_container_detail::reversible_ptr_container<boost::ptr_container_detail::sequence_config<Object,std::vector<void *,std::allocator<void *>>>,boost::heap_clone_allocator>::null_clone_allocator<false>>>
1>        ]
1>        c:\it\personal\collision\sdk\boost\boost\ptr_container\ptr_sequence_adapter.hpp(179) : while compiling class template member function 'void boost::ptr_sequence_adapter<T,VoidPtrSeq,CloneAllocator>::push_back(Object *)'
1>        with
1>        [
1>            T=Object,
1>            VoidPtrSeq=std::vector<void *,std::allocator<void *>>,
1>            CloneAllocator=boost::heap_clone_allocator
1>        ]
1>        c:\it\personal\collision\sdk\boost\boost\ptr_container\ptr_vector.hpp(35) : see reference to class template instantiation 'boost::ptr_sequence_adapter<T,VoidPtrSeq,CloneAllocator>' being compiled
1>        with
1>        [
1>            T=Object,
1>            VoidPtrSeq=std::vector<void *,std::allocator<void *>>,
1>            CloneAllocator=boost::heap_clone_allocator
1>        ]
1>        c:\it\personal\collision\source\world.h(20) : see reference to class template instantiation 'boost::ptr_vector<T>' being compiled
1>        with
1>        [
1>            T=Object
1>        ]
1>c:\it\personal\collision\sdk\boost\boost\ptr_container\detail\reversible_ptr_container.hpp(245) : warning C4127: conditional expression is constant
1>        c:\it\personal\collision\sdk\boost\boost\ptr_container\detail\reversible_ptr_container.hpp(244) : while compiling class template member function 'void boost::ptr_container_detail::reversible_ptr_container<Config,CloneAllocator>::enforce_null_policy(const Object *,const char *)'
1>        with
1>        [
1>            Config=boost::ptr_container_detail::sequence_config<Object,std::vector<void *,std::allocator<void *>>>,
1>            CloneAllocator=boost::heap_clone_allocator
1>        ]
1>        c:\it\personal\collision\sdk\boost\boost\ptr_container\ptr_sequence_adapter.hpp(132) : see reference to class template instantiation 'boost::ptr_container_detail::reversible_ptr_container<Config,CloneAllocator>' being compiled
1>        with
1>        [
1>            Config=boost::ptr_container_detail::sequence_config<Object,std::vector<void *,std::allocator<void *>>>,
1>            CloneAllocator=boost::heap_clone_allocator
1>        ]
1>c:\it\personal\collision\sdk\boost\boost\ptr_container\detail\reversible_ptr_container.hpp(247) : warning C4127: conditional expression is constant
1>c:\it\personal\collision\sdk\boost\boost\ptr_container\detail\reversible_ptr_container.hpp(110) : warning C4127: conditional expression is constant
1>        c:\it\personal\collision\sdk\boost\boost\ptr_container\detail\reversible_ptr_container.hpp(109) : while compiling class template member function 'void boost::ptr_container_detail::reversible_ptr_container<Config,CloneAllocator>::null_clone_allocator<allow_null_values>::deallocate_clone(const Object *)'
1>        with
1>        [
1>            Config=boost::ptr_container_detail::sequence_config<Object,std::vector<void *,std::allocator<void *>>>,
1>            CloneAllocator=boost::heap_clone_allocator,
1>            allow_null_values=false
1>        ]
1>        c:\it\personal\collision\sdk\boost\boost\ptr_container\detail\reversible_ptr_container.hpp(52) : see reference to class template instantiation 'boost::ptr_container_detail::reversible_ptr_container<Config,CloneAllocator>::null_clone_allocator<allow_null_values>' being compiled
1>        with
1>        [
1>            Config=boost::ptr_container_detail::sequence_config<Object,std::vector<void *,std::allocator<void *>>>,
1>            CloneAllocator=boost::heap_clone_allocator,
1>            allow_null_values=false
1>        ]
1>        c:\it\personal\collision\sdk\boost\boost\ptr_container\detail\static_move_ptr.hpp(85) : see reference to function template instantiation 'void boost::ptr_container_detail::clone_deleter<CloneAllocator>::operator ()<Object>(const T *) const' being compiled
1>        with
1>        [
1>            CloneAllocator=boost::ptr_container_detail::reversible_ptr_container<boost::ptr_container_detail::sequence_config<Object,std::vector<void *,std::allocator<void *>>>,boost::heap_clone_allocator>::null_clone_allocator<false>,
1>            T=Object
1>        ]
1>        c:\it\personal\collision\sdk\boost\boost\ptr_container\detail\static_move_ptr.hpp(85) : while compiling class template member function 'boost::ptr_container_detail::static_move_ptr<T,Deleter>::~static_move_ptr(void)'
1>        with
1>        [
1>            T=Object,
1>            Deleter=boost::ptr_container_detail::clone_deleter<boost::ptr_container_detail::reversible_ptr_container<boost::ptr_container_detail::sequence_config<Object,std::vector<void *,std::allocator<void *>>>,boost::heap_clone_allocator>::null_clone_allocator<false>>
1>        ]
1>        c:\it\personal\collision\sdk\boost\boost\ptr_container\ptr_sequence_adapter.hpp(182) : see reference to class template instantiation 'boost::ptr_container_detail::static_move_ptr<T,Deleter>' being compiled
1>        with
1>        [
1>            T=Object,
1>            Deleter=boost::ptr_container_detail::clone_deleter<boost::ptr_container_detail::reversible_ptr_container<boost::ptr_container_detail::sequence_config<Object,std::vector<void *,std::allocator<void *>>>,boost::heap_clone_allocator>::null_clone_allocator<false>>
1>        ]
1>        c:\it\personal\collision\sdk\boost\boost\ptr_container\ptr_sequence_adapter.hpp(179) : while compiling class template member function 'void boost::ptr_sequence_adapter<T,VoidPtrSeq,CloneAllocator>::push_back(Object *)'
1>        with
1>        [
1>            T=Object,
1>            VoidPtrSeq=std::vector<void *,std::allocator<void *>>,
1>            CloneAllocator=boost::heap_clone_allocator
1>        ]

Attachments (2)

reversible_ptr_container.patch (622 bytes) - added by Richard Webb <richard.webb@…> 10 years ago.
silence 4127 warnings from reversible_ptr_container.hpp
move.patch (528 bytes) - added by Richard Webb <richard.webb@…> 10 years ago.
patch to silence C4512 warning on VC8+

Download all attachments as: .zip

Change History (18)

comment:1 follow-up: Changed 10 years ago by Jens Seidel <jensseidel@…>

Hi,

it may be a very stupid response but I do not see any warning at all. I see only the template parameters but it is also hard to scroll in the webpage.

I suggest you post the warnings - and only these - again.

comment:2 in reply to: ↑ 1 ; follow-up: Changed 10 years ago by anonymous

Replying to Jens Seidel <jensseidel@users.sf.net>:

Hi,

it may be a very stupid response but I do not see any warning at all. I see only the template parameters but it is also hard to scroll in the webpage.

I suggest you post the warnings - and only these - again.

I don't really understand what you're trying to say. What's the problem? Please elaborate.

comment:3 in reply to: ↑ 2 ; follow-up: Changed 10 years ago by Jens Seidel <jensseidel@…>

Replying to anonymous:

I don't really understand what you're trying to say. What's the problem? Please elaborate.

Isn't it obvious? Look at the webpage (not your mail copy) http://svn.boost.org/trac/boost/ticket/1488 and tell me a single warning!

Ah, forget it. I copied the message and included it in another editor and could now read "warning C4512: '[snip']: assignment operator could not be generated"

Previously I read only the first columns and lines similar to: 1> with 1> [

I'm sure I even scrolled to the right side but navigation in the code snippet is very, very ugly! I wish a normal file attachment had beed used instead of unreadable Wiki syntax.

comment:4 in reply to: ↑ 3 ; follow-up: Changed 10 years ago by anonymous

Replying to Jens Seidel <jensseidel@users.sf.net>:

Ah, forget it. I copied the message and included it in another editor and could now read

I'm sure I even scrolled to the right side but navigation in the code snippet is very, very ugly! I wish a normal file attachment had beed used instead of unreadable Wiki syntax.

I still have yet to see the problem. I can read everything just fine. At the bottom of the code block is a horizontal scroll bar. You can use that to view the parts that are clipped by the edge of the code block box.

comment:5 in reply to: ↑ 4 ; follow-up: Changed 10 years ago by Jens Seidel <jensseidel@…>

Replying to anonymous:

Replying to Jens Seidel <jensseidel@users.sf.net>:

I'm sure I even scrolled to the right side but navigation in the code snippet is very, very ugly! I wish a normal file attachment had beed used instead of unreadable Wiki syntax.

I still have yet to see the problem. I can read everything just fine. At the bottom of the code block is a horizontal scroll bar. You can use that to view the parts that are clipped by the edge of the code block box.

Maybe it is a browser issue. I use Konqueror in Debian Sid.

I used the horizontal scrollbar at the bottom. But this way I see only the last lines of the bug report which do not include "warning C[0-9]+" but only the callstack and something as T=Object,.

Probably the solution is to check the first columns which are displayed very carefully, after this scroll a few columns to the right and restart reading at the top, the rescroll again and ...

OK, the problem is that the few "warning C[0-9]+" strings are just not easy to find in the large output. Just remember this for future reports or use maybe colors, ...

comment:6 in reply to: ↑ 5 Changed 10 years ago by anonymous

Replying to Jens Seidel <jensseidel@users.sf.net>:

Maybe it is a browser issue. I use Konqueror in Debian Sid.

I used the horizontal scrollbar at the bottom. But this way I see only the last lines of the bug report which do not include "warning C[0-9]+" but only the callstack and something as T=Object,.

Probably the solution is to check the first columns which are displayed very carefully, after this scroll a few columns to the right and restart reading at the top, the rescroll again and ...

OK, the problem is that the few "warning C[0-9]+" strings are just not easy to find in the large output. Just remember this for future reports or use maybe colors, ...

Don't blame me, blame Visual Studio. I would make it more readable if I could. In any case, the majority of people will be able to read it just fine. I'll attach a file later on for the visually impaired.

comment:7 Changed 10 years ago by nesotto

Please submit a patch that get's rid of these warnings

Thanks

-Thorsten

Changed 10 years ago by Richard Webb <richard.webb@…>

silence 4127 warnings from reversible_ptr_container.hpp

comment:8 Changed 10 years ago by Richard Webb <richard.webb@…>

Attached is a patch that silences the 4127 warnings from reversible_ptr_container.hpp on VC8/VC9.

The patch turns off the warning for the whole file, as it comes from several places (e.g. the usage of allow_null_values). Is this ok, or would you prefer the warnings disabled more locally?

comment:9 Changed 10 years ago by nesotto

  • Status changed from new to assigned

I have applied it to trunk

-Thorsten

comment:10 Changed 10 years ago by anonymous

Thanks for updating the trunk. While most of the warnings are gone, there's still one more:

1>c:\it\personal\collision\sdk\boost\boost\ptr_container\detail\move.hpp(23) : warning C4512: 'boost::ptr_container_detail::move_ptrs::move_source<Ptr>' : assignment operator could not be generated
1>        with
1>        [
1>            Ptr=boost::ptr_container_detail::static_move_ptr<Object,boost::ptr_container_detail::clone_deleter<boost::ptr_container_detail::reversible_ptr_container<boost::ptr_container_detail::sequence_config<Object,std::vector<void *,std::allocator<void *>>>,boost::heap_clone_allocator>::null_clone_allocator<false>>>
1>        ]
1>        c:\it\personal\collision\sdk\boost\boost\ptr_container\ptr_sequence_adapter.hpp(182) : see reference to class template instantiation 'boost::ptr_container_detail::move_ptrs::move_source<Ptr>' being compiled
1>        with
1>        [
1>            Ptr=boost::ptr_container_detail::static_move_ptr<Object,boost::ptr_container_detail::clone_deleter<boost::ptr_container_detail::reversible_ptr_container<boost::ptr_container_detail::sequence_config<Object,std::vector<void *,std::allocator<void *>>>,boost::heap_clone_allocator>::null_clone_allocator<false>>>
1>        ]
1>        c:\it\personal\collision\sdk\boost\boost\ptr_container\ptr_sequence_adapter.hpp(179) : while compiling class template member function 'void boost::ptr_sequence_adapter<T,VoidPtrSeq,CloneAllocator>::push_back(Object *)'
1>        with
1>        [
1>            T=Object,
1>            VoidPtrSeq=std::vector<void *,std::allocator<void *>>,
1>            CloneAllocator=boost::heap_clone_allocator
1>        ]
1>        c:\it\personal\collision\sdk\boost\boost\ptr_container\ptr_vector.hpp(35) : see reference to class template instantiation 'boost::ptr_sequence_adapter<T,VoidPtrSeq,CloneAllocator>' being compiled
1>        with
1>        [
1>            T=Object,
1>            VoidPtrSeq=std::vector<void *,std::allocator<void *>>,
1>            CloneAllocator=boost::heap_clone_allocator
1>        ]
1>        c:\it\personal\collision\source\world.h(20) : see reference to class template instantiation 'boost::ptr_vector<T>' being compiled
1>        with
1>        [
1>            T=Object
1>        ]

Changed 10 years ago by Richard Webb <richard.webb@…>

patch to silence C4512 warning on VC8+

comment:11 follow-up: Changed 10 years ago by Richard Webb <richard.webb@…>

Patch to move.hpp to silence C4512 warning on VC8+ attached

comment:12 in reply to: ↑ 11 Changed 10 years ago by anonymous

Replying to Richard Webb <richard.webb@boldonjames.com>:

Patch to move.hpp to silence C4512 warning on VC8+ attached

Thanks for your patch. I tried to apply the patch using TortoiseSVN however it is saying that the patch is out of date? I'm not sure what this means.

comment:13 Changed 10 years ago by Richard Webb <Richard.Webb@…>

I'm not sure either, but i tried applying the patch locally before submitting it and it was ok then.

comment:14 follow-up: Changed 10 years ago by nesotto

I applied it to trunk, and can merge it to the release tomorrow.

-Thorsten

comment:15 in reply to: ↑ 14 Changed 10 years ago by anonymous

Replying to nesotto:

I applied it to trunk, and can merge it to the release tomorrow.

-Thorsten

It seems like all the warnings have gone. Thanks a lot for this, you did a great job. Keep up the great work on BOOST guys. I love it!

PS: How do I resolve this ticket?

comment:16 Changed 10 years ago by nesotto

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

Add Comment

Modify Ticket

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


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

 
Note: See TracTickets for help on using tickets.